When executing the command: npm run build, prompt: npm err! missing script: “build”
1. When executing the command: npm run build, prompt: npm err! missing script: “build”. as shown in Figure 1
PS E:\wwwroot\object> npm run build
npm ERR! Missing script: "build"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Lenovo\AppData\Local\npm-cache\_logs\2022-04-15T01_30_16_068Z-debug.log
2. Check the package.json file, you can confirm that the scripts does not contain the build script. as shown in Figure 2
{
"private": true,
"scripts": {
"test": "jest",
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"production": "mix --production",
"prod": "npm run production",
"gh-pages": "gh-pages -d public/docs -r https://github.com/pheye/wdocs.git",
"analyzer": "NODE_ENV=production npm_config_report=true npm run prod"
},
"devDependencies": {
"@sentry/webpack-plugin": "^1.13.0",
"babel-core": "^6.26.3",
"babel-eslint": "^10.1.0",
"babel-jest": "^25.1.0",
"babel-plugin-component": "^1.1.1",
"babel-plugin-import": "^1.13.0",
"babel-preset-es2015": "^6.24.1",
"credit-card-type": "^9.1.0",
"cross-env": "^5.1",
"eslint": "^6.8.0",
"eslint-config-airbnb": "^18.1.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.19.0",
"gh-pages": "^3.2.3",
"jest": "^25.1.0",
"jest-allure": "^0.1.1",
"jest-puppeteer": "^4.4.0",
"laravel-mix": "^6.0.31",
"laravel-mix-alias": "^1.0.3",
"laravel-mix-bundle-analyzer": "^1.0.5",
"laravel-mix-versionhash": "^2.0.1",
"mockjs": "^1.1.0",
"popper.js": "^1.12",
"postcss": "8.3.1",
"regenerator-runtime": "^0.13.3",
"resolve-url-loader": "^2.3.1",
"sass": "1.32.12",
"sass-loader": "12.3.0",
"sass-resources-loader": "^2.2.4",
"slick-carousel": "^1.8.1",
"terser-webpack-plugin": "5.2.4",
"vue": "^2.5.17",
"vue-custom-scrollbar": "^1.4.0",
"vue-template-compiler": "^2.6.11"
},
"dependencies": {
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.5",
"@babel/plugin-proposal-optional-chaining": "^7.16.5",
"@sentry/browser": "^5.27.0",
"@sentry/integrations": "^5.27.0",
"@stripe/stripe-js": "^1.7.0",
"axios": "^0.21.1",
"babel-polyfill": "^6.26.0",
"better-scroll": "^1.15.2",
"bootstrap": "^4.6.1",
"credit-card-type": "^9.1.0",
"currency-symbol-map": "^4.0.4",
"element-ui": "^2.13.0",
"jquery": "^3.5",
"lazysizes": "^5.2.0",
"lodash": "^4.17.21",
"normalize.css": "^8.0.1",
"puppeteer": "^2.1.1",
"qs": "^6.10.1",
"slick-carousel": "^1.8.1",
"uuid": "^7.0.3",
"vue-awesome-swiper": "^3.1.3",
"vue-country-flag": "^2.0.1",
"vue-custom-scrollbar": "^1.4.0",
"vue-i18n": "^8.22.2",
"vue-loader": "15.9.8",
"vue-phone-number-input": "^1.1.7",
"vue-social-sharing": "^2.4.7",
"vue-waterfall2": "^1.10.1",
"vue-youtube": "^1.4.0",
"vuex": "^3.1.2"
}
}
3. According to the prompt: to see a list of scripts, run: npm run. To view a list of scripts, run npm run. Support: npm run dev, npm run prod. as shown in Figure 3
PS E:\wwwroot\object> npm run
Lifecycle scripts included in undefined:
test
jest
available via `npm run-script`:
dev
npm run development
development
mix
watch
mix watch
watch-poll
mix watch -- --watch-options-poll=1000
hot
mix watch --hot
production
mix --production
prod
npm run production
gh-pages
gh-pages -d public/docs -r https://github.com/pheye/wdocs.git
analyzer
NODE_ENV=production npm_config_report=true npm run prod
4. Execute npm run dev , the operation is successful. as shown in Figure 4
PS E:\wwwroot\object> npm run dev
> dev
> npm run development
> development
> mix
● Mix █████████████████████████ emitting (98%)
after emit
Laravel Mix v6.0.39
✔ Compiled Successfully in 127974ms



