When I run node -v on my Linux system, I get v16.7.0 as expected given the installed binaries on my PATH, but when my package.json has a scripts element including node -v which is invoked, it prints v9.11.2. Why is that?
(The issue was discovered because it also seems to be actually using the older version, which omits features used by a script I want to run, but -v is the minimal example.)
When I run which/whereis node/npm I get the same result, the expected directory where the binaries are located, which is on my PATH. In looking through other directories on my PATH, I do not see any node/npm executables.
echo "$NODE_PATH" with or without quotes prints a blank line.
I don't see any answers in a $HOME/.npmrc file.
Where is it getting Node v9 from, and how can I fix that so that calling node from within an npm script invokes a more modern version?