nodemon not working properly

后端 未结 13 1235
我在风中等你
我在风中等你 2021-02-01 05:20

I am running my nodejs app by npm start

I just installed nodemon by sudo npm install -g nodemon so that i can get my server restarted when i s

相关标签:
13条回答
  • 2021-02-01 05:38

    In my case, I had to install nodemon globally. Use this command to do so..

    npm install -g nodemon
    

    If you're using Linux you may need to prefix the command with the sudo keyword for administration access..

    sudo npm install -g nodemon
    
    0 讨论(0)
  • 2021-02-01 05:44

    If you are using express4, the easiest way is to navigate to package.json and change "scripts": { "start": "node ./bin/www" }

    to "scripts": { "start": "nodemon ./bin/www" }

    0 讨论(0)
  • 2021-02-01 05:46

    thanks you need to type this after to enter in the folder application with

    cd your_project_folder

    sudo nodemon bin/www

    0 讨论(0)
  • 2021-02-01 05:48

    Use single quotation for multi-value args like `--exec'.

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

    0 讨论(0)
  • 2021-02-01 05:49

    Add following code in your code

    1. app.js

      app.listen(3000, function(){
          console.log("info",'Server is running at port : ' + 3000);
      });
      
    2. package.json

      nodemon app.js 
      

    Then run npm start from the command line.

    0 讨论(0)
  • 2021-02-01 05:49

    For Express 4; Just run

    nodemon

    command (with out any args) on the directory; this works for me.

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