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

前端 未结 18 816
灰色年华
灰色年华 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:32
    npm install nodemon --save-dev
    

    Next package.json on and

    "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "nodemon app.js"
    }
    

    Type on terminal (command prompt)

    npm start
    
    0 讨论(0)
  • 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
    
    0 讨论(0)
  • 2021-01-30 04:38

    For nodemon: not found command I tried with many links but was not working then i tried with the below steps it worked fine.

    Follow this step it worked for me.

    step1 : sudo su

    step2 : npm install -g nodemon --save-dev

    It is working fine.

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

    in Windows OS run:

    npx nodemon server.js
    

    or add in package.json config:

    ...
    "scripts": {
        "dev": "npx nodemon server.js"
      },
    ...
    

    then run:

    npm run dev
    
    0 讨论(0)
  • 2021-01-30 04:40

    I had the same exact problem, expect for Windows OS.

    For me, running

    npm install -g nodemon --save-dev

    (note the -g) worked.

    Maybe somebody else who has this problem on Windows will have the same solution.

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

    I tried the following, and none worked:

    npm uninstall nodemon
    
    sudo npm uninstall -g nodemon
    

    What did work was:

    sudo npm install -g --force nodemon
    
    0 讨论(0)
提交回复
热议问题