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

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

    From you own project.

    npx nodemon [your-app.js]
    

    With a local installation, nodemon will not be available in your system path. Instead, the local installation of nodemon can be run by calling it from within an npm script (such as npm start) or using npx nodemon.

    OR

    Create a simple symbolik link

    ln -s /Users/YourUsername/.npm-global/bin/nodemon /usr/local/bin
    

    ln -s [from: where is you install 'nodemon'] [to: folder where are general module for node]

    node : v12.1.0

    npm : 6.9.0

提交回复
热议问题