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

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

    0 讨论(0)
  • 2021-01-30 04:15
    sudo su
    

    then

    npm install nodemon 
    

    worked for me

    0 讨论(0)
  • 2021-01-30 04:15

    Just writing what did worked for me - (on Windows machine, installing node locally to the project) if you do not want to install it globally (i.e without -g flag) you have to use

    npx nodemon app
    

    where app is your app.js is your program file to launch.

    0 讨论(0)
  • 2021-01-30 04:15

    In Windows git bash, I fixed it by restarting git bash

    0 讨论(0)
  • 2021-01-30 04:20

    I'm using macOS/Linux, the solution that works for me is

    npx nodemon index.js 
    

    I have tried every possibility, like uninstalling and installing nodemon, installing nodemon globally. restart the terminal, but it won't work.

    don't try such things to waste your time.

    0 讨论(0)
  • 2021-01-30 04:21

    Put --exec arg in single quotation.

    e.g. I changed "nodemon --exec yarn build-langs" to "nodemon --exec 'yarn build-langs'" and worked.

    0 讨论(0)
提交回复
热议问题