nodemon not working properly

后端 未结 13 672
长发绾君心
长发绾君心 2021-02-01 05:18

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:25

    try

    npm install --save-dev nodemon
    

    and then in package.json file keep like this

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

    instead of npx nodemon, which takes more time

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

    try running nodemon ./app.js 3000 or nodemon start 3000

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

    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:29

    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:30

    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:31

    For Express.js 4,
    use nodemon
    or
    nodemon bin/www

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