volta-cli/volta

Should we force download of Node when pinning npm@bundled?

Open

#724 aperta il 29 apr 2020

Vedi su GitHub
 (0 commenti) (1 reazione) (0 assegnatari)Rust (189 fork)batch import
enhancementgood first issue

Metriche repository

Star
 (8309 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Currently, if we can't figure out the bundled npm version when running volta pin npm@bundled, we show an error. One legitimate use-case where we wouldn't be able to determine the bundled version, but wouldn't want to show an error, is when the user hasn't downloaded a given version of Node yet, but will the next time they run a Node command. To work around that, @rwjblue suggested that we kick off the auto-download of Node as part of pinning (or installing) npm@bundled. Then we would know for sure that if we can't determine the bundled npm version, we have a true error.

While this would be a difference from pinning npm@<version> or pinning yarn, given that the npm@bundled concept is fundamentally tied to the node version, it makes sense as a deviation. Instead of fetching a specific version of npm or yarn, we fetch the appropriate version of node for the context (most of the time we'll already have it, but just in case).

Guida contributor