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

前端 未结 18 819
灰色年华
灰色年华 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:36

    In macOS, I fixed this error by installing nodemon globally

    npm install -g nodemon --save-dev 
    

    and by adding the npm path to the bash_profile file. First, open bash_profile in nano by using the following command,

    nano ~/.bash_profile
    

    Second, add the following two lines to the bash_profile file (I use comments "##" which makes it bash_profile more readable)

    ## npm
    export PATH=$PATH:~/npm
    

提交回复
热议问题