Home > Net >  How I can change node versions for my project?
How I can change node versions for my project?

Time:10-12

At the moment npm install/build are using with node 8.9.4 (and with npm 5.6.0). And during deploying some code it always reinstall modules and I spend a lot of time. I know that it should cache packages but it doesn't work. So I want to update my node version and make the version 16.11.0 (with npm version 8.0.0) as stable. Because when I make nvm list it shows me with the green arrow near 8.9.4. Also when I make node --v it also shows me version 8.9.4.

So how I can update the node version to 16.11.0 in my project? Also it should be available for other developers. When they open the project and start npm install/build it should use node 16.11.0 with npm 8.0.0.

CodePudding user response:

The following post may help you: How to change to an older version of Node.js

Also, every developer will have to make sure they are running the correct version of node, since we have no way to "require" a specific version of node in package.json, unless you write code to manually enforce that during application startup. In that case, Check for current Node Version

CodePudding user response:

I think you need to specify engines in package.json Just specify the node version or node range - you are expecting your stuffs to work on.

  • Related