Sunday, 23 April 2017

npm packages not available when installed locally

I am working with npm on a web app and I found an issue when using some packages that requires terminal commands to run such like nodemon and concurrently

I installed it via

sudo npm install --save-dev nodemon

and when I try to use it via:

nodemon ./server.js

I get an error

nodemon command not found

and the same when I used concurrently

I tried also with

sudo npm install --save nodemon 

and it doesn't work.

it only work if I installed it globally

sudo npm install -g nodemon

Why I can't use it when install locally?

Note: I can found the executable file at node_modules/.bin



via Peter Wilson

No comments:

Post a Comment