I am running a javascript project which runs version node version 16. However, when I run the project it is attempting to build the project with version 12. I have used a find and removed every version of node globally and I also pruned the cache. I have removed every reference to node other than version 16, yet when I run the project it still looks for version 12. I am at my wits end as I really don’t know where else the node command cli is finding node version 12. Every hidden .npm etc node packages have been removed but clearly it is attempting to use version 12. How is it determining it needs version 12? Please help as I cannot run the project which really needs version 16.
Question posted in Javascript
A very good W3school tutorial can be found here.
A very good W3school tutorial can be found here.
2
Answers
since your Question is not specifiying your environment there are several possible answers:
If you are using NodeJS from a terminal like windows cmd or linux shell
It’s important to look at your PATH-variables. In both Linux and Windows surroundings its important to have a PATH variable like this
/path/to/node-installation/bin
Have a look here: How to Change PATH under Linux
Its important to have an entry in the PATH-variable to point to the bin folder of your desired nodejs installation.
Also make sure theres only one single source for nodejs since it depends on the software u are using on how to interpret the PATH.
Under Linux you can use
echo $PATH
(list can be seperated by:
) to verify.Under Windows its
echo %PATH%
(list can be seperated by;
).If u are using Windows, it should look something like this
C:pathtonodeJsbin
.Have a look here: How to change Path under Windows
Basically you can automate this process by using NVM Node Version Manager.
It will handle everything for you.
If you use Atom
Atom specifies its own nodejs version. The path for this nodejs installation would be
C:Program FilesAtomresourcesappapmbin
Any other IDE / Programm
Other IDEs might use its own Nodejs aswell. If you editing your question and specifiy your environment which you use node in we might be able to give better answers.
Hope this helps! Cheers!
Within a Node.js application, the location of the Node.js executable is in
process.execPath
. So, have your build process log that value, and that will tell you where your Node.js executable is.If the issue is that the build process is demanding a version of Node.js, check the
engines
value inpackage.json
.