volta-cli/volta

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

Open

#724 opened on 2020年4月29日

GitHub で見る
 (0 comments) (1 reaction) (0 assignees)Rust (189 forks)batch import
enhancementgood first issue

Repository metrics

Stars
 (8,309 stars)
PR merge metrics
 (30d に merged PR はありません)

説明

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

コントリビューターガイド