PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, October 20, 2022

[FIXED] How to resolve npm run dev missing script issues?

 October 20, 2022     git-bash, node.js, webpack     No comments   

Issue

I am currently in the folder 'C:\Users\vignesh\Documents\Personal Projects\Full-Stack-Web-Developement' on gitbash

npm run dev

executing the above command on gitbash gives me the following error. I am assuming this is due to the NODE_PATH variables not being set properly. Please let me know if anyone has a solution to the below problem

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
npm ERR! node v4.4.6
npm ERR! npm  v2.15.5

npm ERR! missing script: dev

Solution

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



Answered By - Michał Ignaszewski
Answer Checked By - Mildred Charles (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

1,206,305

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © 2025 PHPFixing