volta icon indicating copy to clipboard operation
volta copied to clipboard

node version displayed does not match the actual version.

Open caopeng-hi opened this issue 5 months ago • 6 comments

After I switched to a higher version of node, when I switched back to a lower version, it showed that the change was effective, but in reality, it did not take effect and I am still on the higher version of node.

caopeng-hi avatar Jul 03 '25 02:07 caopeng-hi

Are you facing this issue with pnpm specifically? https://github.com/volta-cli/volta/issues/1743#issuecomment-2096122673 might help.

When I run node -v it shows me the version I switched to. But previously, running pnpm node -v would show me a different version.

teemingc avatar Jul 08 '25 06:07 teemingc

Are you facing this issue with pnpm specifically? #1743 (comment) might help.

When I run node -v it shows me the version I switched to. But previously, running pnpm node -v would show me a different version.

Indeed, when I use 'pnpm node -v', it shows a different version, but this is not the issue I described. When I use 'node -v', it shows that my node version is v20.16.0, while 'pnpm node -v' shows that my node version is v18.19.0. However, the actual version I should be using should be higher than v20.16.0. I don't know if you can understand my description.

caopeng-hi avatar Jul 09 '25 06:07 caopeng-hi

It sounds like the same problem I had where the Node version I've set with Volta is not the same as what pnpm uses. Try adding this to your shell profile, restart, and see if it helps:

# volta
export VOLTA_FEATURE_PNPM=1

teemingc avatar Jul 09 '25 06:07 teemingc

It sounds like the same problem I had where the Node version I've set with Volta is not the same as what pnpm uses. Try adding this to your shell profile, restart, and see if it helps:

volta

export VOLTA_FEATURE_PNPM=1

I'm sorry, I tried your method but it seems it didn't solve my problem. My current node version is v20.16.0, and when using yarn to download, it's not compatible with plugins for this version, yet I can still download successfully. I don't know what the situation is.

caopeng-hi avatar Jul 09 '25 07:07 caopeng-hi

It sounds like the same problem I had where the Node version I've set with Volta is not the same as what pnpm uses. Try adding this to your shell profile, restart, and see if it helps:

volta

export VOLTA_FEATURE_PNPM=1

I'm sorry, I tried your method but it seems it didn't solve my problem. My current node version is v20.16.0, and when using yarn to download, it's not compatible with plugins for this version, yet I can still download successfully. I don't know what the situation is.

I see. Perhaps there's an incompatibility between Volta and Yarn which causes Yarn to use the wrong Node version.

A really annoying temporary workaround is to uninstall Volta and reinstall it. Yarn should then use the first Node version that you install. But you have to keep doing this to change version if you really need to use Volta

teemingc avatar Jul 09 '25 07:07 teemingc

It sounds like the same problem I had where the Node version I've set with Volta is not the same as what pnpm uses. Try adding this to your shell profile, restart, and see if it helps:

volta

export VOLTA_FEATURE_PNPM=1

I'm sorry, I tried your method but it seems it didn't solve my problem. My current node version is v20.16.0, and when using yarn to download, it's not compatible with plugins for this version, yet I can still download successfully. I don't know what the situation is.

I see. Perhaps there's an incompatibility between Volta and Yarn which causes Yarn to use the wrong Node version.

A really annoying temporary workaround is to uninstall Volta and reinstall it. Yarn should then use the first Node version that you install. But you have to keep doing this to change version if you really need to use Volta

It is indeed a headache, and uninstalling the high version of node using volta was unsuccessful; it seems I can only uninstall volta.

caopeng-hi avatar Jul 09 '25 07:07 caopeng-hi