qwerty qwerty - 1 month ago 11
Node.js Question

Unable to install nodemon node.js

I am having issue installing nodemon on OSX 10.11.5. Once I run the command (either 'npm install -g nodemon' or adding sudo), I am getting '-bash: nodemon: command not found' error.

I get the following when I install nodemon:


fsevents@1.0.14 install /Users/oioi/.node/lib/node_modules/nodemon/node_modules/chokidar/node_modules/fsevents
node-pre-gyp install --fallback-to-build

[fsevents] Success:
"/Users/oioi/.node/lib/node_modules/nodemon/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node"
already installed

Pass --update-binary to reinstall or --build-from-source to recompile
/Users/oioi/.node/bin/nodemon ->
/Users/oioi/.node/lib/node_modules/nodemon/bin/nodemon.js
nodemon@1.11.0 /Users/oioi/.node/lib/node_modules/nodemon


I tried passing '-update-binary' to reinstall or '--build-from-source', as well as cleaning cache, restarting terminal, updating my path and nothing worked. I suspect that when I run 'npm delete nodemon', it does not delete duplicated version, but I have no idea how to fix it.

Is anyone able to help?

Answer

The nodemon executable is installed in a non-standard location (probably because you installed Node using Homebrew):

/Users/oioi/.node/bin/nodemon

Which means that you either need to add /Users/oioi/.node/bin/ to your $PATH, or call the executable with the full path:

/Users/oioi/.node/bin/nodemon my-app.js