Issue
I just started to use node.js in local projects few days ago. My application works good, if I run it from command shell
nvm run 0.10.32 ./bin/www app
node ./bin/www app
So, it works with node version 0.10.xx or higher. But there is a problem: I can't debug it from WebStorm - it throws lots of errors. I went to settings and was stunned: "Node.js core modules version is 0.6.12". Then, I've checked the installed versions of node and it returns
user@user-VirtualBox:~/$ nvm ls
-> v0.10.24 v0.10.32 system
and when I type
nvm use system
it 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 is being able to debug my application code from webstorm. How can I get it - change system version of node, or maybe another ways? Any tips would be very helpful.
Solution
Verify that default node is really coming from nvm with which node
, if its not, you can safely run :
rm `which node`
To set the default node version with nvm use :
nvm alias default 0.10.32
If you have many apps that use different node version, add a .npmrc in the root directory in each of them. .npmrc only contains the version, e.g. "v0.10.32".
Then each time you cd
into a project run
nvm use
Answered By - FGRibreau Answer Checked By - Robin (WPSolving Admin)