Home » Nodejs » When using nvm to manage your node versions, should you point webstorms node interpreter to it?

When using nvm to manage your node versions, should you point webstorms node interpreter to it?

Posted by: admin November 30, 2017 Leave a comment

Questions:

When you switch to the nvm to manage your node versions, should you point your node interpreter to that one?

ie from /usr/bin/node to the ~/.nvm/v.xxx one

I ask because I’m running into some issues with webstorm when trying to debug node stuff now.

Answers:

Best thing I’ve found so far is to add each version to Default ‘Node.js and NPM’ Settings (rather than in individual Project settings). Then when creating new projects, or updating existing ones, you can select that version from the dropdown instead of having to recreate it for each project.

But it would be nice if the NodeJS Plugin would look for nvm and integrate with it. Or if nvm would create symlink for /usr/bin/node and update that when you change the version.

Questions:
Answers:

Yes, you need to explicitly set the Node Interpreter to the version you’d like to use

Questions:
Answers:

You should not need to do that, it seems it was a bug that was identified and reported. A fix will be released in the coming 2016.1.3 EAP version of WebStorm.

https://youtrack.jetbrains.com/issue/WEB-21558

Questions:
Answers:

As @zenw0lf stated above, WS does now look for installed node versions under .nvm but since .nvm does not yet add an alias for the active version of node, the specified value is fragile as it’s version-based.

I’ve attempted to resurrect the appropriate issue in NVM to alleviate this. Please follow that for updates.