volta-cli/volta

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

Open

#724 opened on Apr 29, 2020

View on GitHub
 (0 comments) (1 reaction) (0 assignees)Rust (8,309 stars) (189 forks)batch import
enhancementgood first issue

Description

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).

Contributor guide