nodemon not found in npm

前端 未结 29 1449
终归单人心
终归单人心 2020-12-24 10:17

I have a problem: nodemon does not run off the npm script (e.g. npm start),
but if nodemon is called on the command line outside the npm script, nodemon run

29条回答
  •  旧巷少年郎
    2020-12-24 10:49

    under your current project directory, run

    npm install nodemon --save //save in package.json so that the following code cam find your nodemon
    

    then under "scripts" in your package.json file, add "start": "nodemon app.js" (or whatever your entry point is)
    so it looks like this:

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

    and then run

    npm start
    

    That avoids complicate PATH settings and it works on my mac
    hope can help you ;)

提交回复
热议问题