So that I don't have to keep restarting node.js during development I'm trying to use node-dev. Unfortunately, when I try to run node-dev from terminal I receive the error:
$ node-dev server.js
-bash: node-dev: command not found
I have globally installed node-dev via the npm install node-dev -g
command. The output from this command is:
npm http GET https://registry.npmjs.org/node-dev
npm http 304 https://registry.npmjs.org/node-dev
npm http GET https://registry.npmjs.org/growl
npm http 304 https://registry.npmjs.org/growl
/usr/local/share/npm/bin/node-dev -> /usr/local/share/npm/lib/node_modules/node-dev/node-dev
[email protected] /usr/local/share/npm/lib/node_modules/node-dev
└── [email protected]
To be sure node-dev is installed globally I've run npm ls -g
which returns:
/usr/local/share/npm/lib
└─┬ [email protected]
└── [email protected]
Some other posts have indicated that my globally installed npm modules should be in the /usr/local/lib/node_modules
folder instead of /usr/local/share/npm/lib/
. I can't tell if this is for older versions of npm or something that actually matters.
I'm new to both Mac OS X and Node development so it wouldn't surprise me that I was overlooking something trivial. What haven't I done which is causing me to get a "command not found" error when trying to utilize node-dev? Is there some sort of $PATH environment issue I'm overlooking?
One note I don't have Growl installed but the node-dev documentation indicated it was optional.
I think this could be your issue, and here's a walk-through to fixing it. It's specifically for WebStorm & Mocha, but seems like it could be related. I think you may need to setup an alias.