Unexpected node version, while setting direnv

I’m following the instruction on this doc to set-up my local dev environment. And direnv allow commands keeps remind me this error:

Unexpected node version. Recommended to use https://github.com/volta-cli/volta

make: *** [node-version-check] Error 1

I followed the instruction on volta section to check my node version. And the package.json file, volta is expecting a node version of 12.19.0, and I have a 12.19.0 node in my environment.

“volta”: {
“node”: “12.19.0”,
“yarn”: “1.22.5”

How could solve this warning?

This is the line that does the check:

Can you run node -pe "Number(!(process.version == 'v' + require('./package.json').volta.node ))" and see what you get in return?

Thanks for your reply! The output is 0 in my case.

I found the problem:

  1. When I enter the directory of sentry, the process.version is v18.18.3;
  2. After I’ve entered the directory of sentry, the process.version is v12.19.0, that matches the version in package.json;

I tried to update my global node version to v12.19.0. But the process.version when entering the sentry dir is still v18.18.3;

Are you using direnv and volta? If you are using volta, I think you should get rid of any node on your system, especially one available on your path and let volta shims take over. This maybe due to that.