You saw this error because there probably wasn’t a script named dev in the "scripts" section of your package.json
npm installand npm run dev- two completely different ideas
npm install will be executed through the dependency section of package.json and selecting / installing modules in this list
npm run dev package.json "dev", script "dev", , (, Dev , - , .)
package.json
{
"name": "testapp",
"version": "1.0.0",
"description": "",
"scripts": {
"dev": "echo This is the DEV script",
"abc": "echo This is the abc script",
"xyz": "echo This is the xyz script",
"start":"echo This is the special start script"
}
}
, cd , package.json, , :
npm run dev, " dev script"
npm run abc scree " abc script"
npm run xyz " xyz script"
npm run linkxu1989 , , script "linkxu1989" package.json
npm start " script" ( , start - . npm start npm run start,
: "scripts" package.json npm run SCRIPT_NAME
, NPM!
.