nodemon not working: -bash: nodemon: command not found

前端 未结 18 1182
灰色年华
灰色年华 2021-01-30 03:45

I\'m on a Mac running El Capitan. I have node v5.6.0 and npm v3.6.0. When I try to run nodemon, I get:

-bash: nodemon: command not found

I th

18条回答
  •  忘了有多久
    2021-01-30 04:22

    I ran into the same problem since I had changed my global path of npm packages before.

    Here's how I fixed it :

    When I installed nodemon using : npm install nodemon -g --save , my path for the global npm packages was not present in the PATH variable .

    If you just add it to the $PATH variable it will get fixed.

    Edit the ~/.bashrc file in your home folder and add this line :-

    export PATH=$PATH:~/npm
    

    Here "npm" is the path to my global npm packages . Replace it with the global path in your system

提交回复
热议问题