-
Notifications
You must be signed in to change notification settings - Fork 329
Closed
Description
Hi,
If I pin a node version in a project (let's say 15.11.0), this is added to package.json:
"volta": {
"node": "15.11.0"
}
So far so good.
However, if I want to make sure that the bundled npm is used, and run volta pin npm@bundled, nothing happens, package.json is not updated with anything.
This is problematic, because there's no distinction between two cases:
- I want to use the bundled npm.
- I want to use the global default npm.
And in fact, if I set a different npm version as global default, that's gonna be the one that's executed in the project directory, not the bundled one.
To remedy this, I think there could be two solutions:
- If node is pinned in the project, but npm is not, use bundled npm.
This would intuitively make sense to me, since there supposedly wouldn't be much value in fixing node, but allowing whatever npm, since the point is to standardize the environment (and also, for example, thepackage-lock.jsonformat can depend on npm version, so you want to keep it aligned between developers). - Introduce
bundledas a valid version for npm inpackage.json, like on the command line.
This is more explicit than the above, but for reasons explained there, I prefer that option to this one.
What do you think?
Reactions are currently unavailable