nodemon not found in npm

前端 未结 29 1462
终归单人心
终归单人心 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:57

    This worked for me ...

    Install nodemon as a local dev dependency

    npm install --save-dev nodemon
    

    Add script to your application package.json to start the application.

    "scripts": {
      "start": "nodemon app.js"
    },
    

    Start nodemon with npm start

    $ npm start
    
    > node-rest-demo@1.0.0 start node-rest-demo
    > nodemon app.js
    
    [nodemon] 1.19.4 [nodemon] to restart at any time, enter `rs` [nodemon] watching dir(s): *.* [nodemon] watching extensions: js,mjs,json [nodemon] starting `node app.js` Starting server ...
    

提交回复
热议问题