How to resolve npm run dev missing script issues?

Simply check the package.json file and see what the name of the key is for dev. In my case it was start instead of dev, so I ran npm run start and that did it.

Screenshot:

Screenshot


npm run <command>

will run bash script from package.json from 'scripts' value of '' attribute. For example:

package.json

{
   "name": "app",
   "version": "0.0.0",
   "license": "MIT",
   "scripts": {
      "server": "webpack-dashboard -- webpack-dev-server --inline --port 8080",
      "webdriver-update": "webdriver-manager update",
   },
  "dependencies": {
   "@angular/common": "~2.2.0",
   "@angular/core": "~2.2.0"
   },
  "devDependencies": {
   "@types/core-js": "^0.9.0"
   }
}

In this case you can run scripts:

npm run server
npm run webdriver-update

In your case you probably wont have dev script.

Remember that few scripts name are reserved (for example npm test will try to run, npm run pretest, npm run test, npm run posttest). More info on https://docs.npmjs.com/misc/scripts


After you install:

npm install --save-dev nodemon

Go in the package.json and add "dev": "nodemon ./bin/www"