volta
volta copied to clipboard
`pmpm` uses the `node` version it was installed it instead of currently active/pinned version
Given volta's active node version is i.e. v20.8.1
When I install pnpm with volta
And I install and pin a different node version i.e. v21.0.0
Then pnpm still uses the previous node version v20.8.1
Steps to reproduce:
volta install [email protected]
volta install [email protected]
volta install [email protected]
volta pin [email protected]
pnpm run dev
With package.json containing:
"packageManager": "[email protected]",
"volta": {
"node": "21.0.0"
},
"engines": {
"node": "21.0.0",
"pnpm":"8.9.2"
}
The following warning appears and reveals that the incorrect node version is used under the hood:
WARN Unsupported engine: wanted: {"node":"v21.0.0"} (current: {"node":"v20.8.1","pnpm":"8.9.2"})
Also hitting this with pnpm 8.9+ and volta (yes VOLTA_FEATURE_PNPM=1 is set)
+1 and I cannot uninstall Node that volta installed
I can't reproduce with steps that OP posted. I may be able to take this issue on but I need a certainly reproducible way to reproduce.
volta install [email protected]
volta install [email protected]
volta install [email protected]
volta pin [email protected]
volta pin [email protected]
pnpm run dev
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "node index.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"volta": {
"node": "21.0.0",
"pnpm": "8.9.2"
}
}
VOLTA_FEATURE_PNPM=1
I got this working with this export:
❯ pnpm install WARN Unsupported engine: wanted: {"node":">=18"} (current: {"node":"v16.20.0","pnpm":"8.6.2"}) Lockfile is up to date, resolution step is skipped Already up to date
[email protected] prepare /Users/theo.despoudis/Workspace/datree husky install
husky - Git hooks installed Done in 1.2s ❯ export VOLTA_FEATURE_PNPM=1 ❯ pnpm install Lockfile is up to date, resolution step is skipped Already up to date
[email protected] prepare /Users/theo.despoudis/Workspace/datree husky install
husky - Git hooks installed Done in 1.1s
I also experience the same issue with the [email protected] and [email protected].
The project has declared the [email protected], shown in the picture below, with node -v.
While executing the pnpm node -v, the node version used was [email protected], which was the node version used when installing the pnpm.
Let's say we run the NextJS project with the pnpm dev; then the node version is attached to the pnpm, not the one declared in the project itself.
I have also tried adding the global environment variable stated in https://docs.volta.sh/advanced/pnpm; it looks like the feature is still experimental.
I would appreciate it if someone could help with this issue; thank you!
I also experience the same issue with the
[email protected]and[email protected].The project has declared the
[email protected], shown in the picture below, withnode -v. While executing thepnpm node -v, the node version used was[email protected], which was the node version used when installing thepnpm.Let's say we run the NextJS project with the
pnpm dev; then the node version is attached to thepnpm, not the one declared in the project itself.I have also tried adding the global environment variable stated in https://docs.volta.sh/advanced/pnpm; it looks like the feature is still experimental.
I would appreciate it if someone could help with this issue; thank you!
You are using volta v1.0.5 while the VOLTA_FEATURE_PNPM feature support was introduced in Volta v1.1.1...
I also experience the same issue with the
[email protected]and[email protected]. The project has declared the[email protected], shown in the picture below, withnode -v. While executing thepnpm node -v, the node version used was[email protected], which was the node version used when installing thepnpm. Let's say we run the NextJS project with thepnpm dev; then the node version is attached to thepnpm, not the one declared in the project itself. I have also tried adding the global environment variable stated in https://docs.volta.sh/advanced/pnpm; it looks like the feature is still experimental. I would appreciate it if someone could help with this issue; thank you!You are using volta v1.0.5 while the
VOLTA_FEATURE_PNPMfeature support was introduced in Volta v1.1.1...
You are right, @chawyehsu, thank you. The docs should have mentioned the minimum version of the Volta itself.
I had the same issue even with Volta v1.1.1 and VOLTA_FEATURE_PNPM flag enabled, but managed to fix it by uninstalling pnpm and installing it again while node 20.11.0 was pinned.
So just:
volta uninstall pnpm
volta pin [email protected]
( or volta install [email protected] to have it as a default node version )
volta install pnpm
And now this command finally tells me that pnpm uses my desired node version:
pnpm node --version
> 20.11.0
Seeing this too. The uninstall/reinstall workaround works for me.
