Using webstorm 2016.2.3 with Node JS

I recently ran into a little problem setting up a new Node.js project on a Linux (Ubuntu 16 with Cinnamon) VM.

Trying to create a new application I was asked to pick a ‘Node interpreter’ … no problem I thought, and ran a which command for nodes.

$which nodejs
/usr/bin/nodejs

Awesome… that’s us done right… nope.

untitled
Oh, ok, surely that’s /usr/bin/npm right?

 

untitled
Nope, and don’t call me Shirley.

I will come clean here, I am not a node expert, and this is a bit new to me. I think at some point there has been a change, and the old ‘node’ paths and keywords have changed to ‘nodejs’ and things have moved, thus all my google searches have come up wanting. Either that or I got apt-get happy and installed some weird version of node. When I tried to run ‘node -v’ I got told it wasn’t installed, and that I should could install it by using apt-get and looking for something called ‘node-legacy’ so I figured I had the latest version.

I found a stack overflow post that suggested running ‘npm root -g’

$npm root -g
/usr/local/lib/node_modules

Great right? … only that doesn’t exist on my machine. However, the error said that it couldn’t find ‘npm-cli.js’ under that directory… A quick file search later and I have found it.

/usr/share/npm/bin/npm-cli.js

Bazinga! It worked.. I put in the ‘/usr/share/npm’ setting, and it seems to be happy with that. I am not sure what has happened, if I’ve installed something wrong, or this is just where stuff goes, or I’ve installed it with some weird config. Maybe someone smarter, or more knowledgable than me will come across this and let me know in the comments.

 

Blog at WordPress.com.

Up ↑