volta icon indicating copy to clipboard operation
volta copied to clipboard

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

Open charlespierce opened this issue 5 years ago • 0 comments

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

charlespierce avatar Apr 29 '20 22:04 charlespierce