Change nodejs system version - ubuntu

I just started using node.js in local projects a few days ago. My application works well if I run it from the shell

nvm run 0.10.32 ./bin/www app 

or

 node ./bin/www app 

So, it works with node version 0.10.xx or higher. But there is a problem: I cannot debug it from WebStorm - this causes a lot of errors. I went into settings and was stunned: "Node.js version of the kernel modules is 0.6.12." Then I checked the installed versions of node and returned

 user@user-VirtualBox :~/$ nvm ls 

-> v0.10.24 v0.10.32 System

and when i type

 nvm use system 

He says,

 /home/user/.nvm/*/bin removed from $PATH /home/user/.nvm/*/share/man removed from $MANPATH /home/user/.nvm/*/lib/node_modules removed from $NODE_PATH Now using system version of node: v0.6.12. 

Obviously, I need to change the system version of nodejs. I tried to update, remove, reinstall - no results, it still has this version. All I need to do is debug the application code from webstorm. How can I get it - change the system version of node or maybe other ways? Any advice would be very helpful.

+5
source share
2 answers

Make sure that by default node really comes from nvm with which node , if it is not there, you can safely run:

 rm `which node` 

To install the default version of node using nvm:

 nvm alias default 0.10.32 

If you have many applications that use different versions of node, add .npmrc to the root directory in each of them .. npmrc contains only the version, for example. "V0.10.32".

Then every time you cd run the project

 nvm use 
+5
source

You must install the correct version:

 nvm install xyz 

and then specify an alias for this version:

 nvm alias default xyz 

Note. you must restart (close and reopen) your terminal in order to apply the changes.

0
source

Source: https://habr.com/ru/post/1205674/