npm ERR! missing script: build
微wx笑
2020-12-15【前端开发】
241
4
0关键字:
在构建一个项目的时候,提示 npm ERR! missing script: buildnpm run buildnpm ERR! missing script: buildnpm ERR! A complete log of this run can be found in:npm ERR!
在构建一个项目的时候,提示 npm ERR! missing script: build
1 2 3 4 5 | npm run buildnpm ERR! missing script: buildnpm ERR! A complete log of this run can be found in:npm ERR! /Users/aven/.npm/_logs/2020-12-15T07_33_19_954Z-debug.log |
这种错误查看 package.json 中scripts 参数配置
1 2 3 4 5 6 7 8 9 10 11 | "scripts": {"dev": "vue-cli-service serve","lint": "eslint --ext .js,.vue src","build:prod": "vue-cli-service build","build:stage": "vue-cli-service build --mode staging","preview": "node build/index.js --preview","new": "plop","svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml","test:unit": "jest --clearCache && vue-cli-service test:unit","test:ci": "npm run lint && npm run test:unit"}, |
我这个项目是 build:prod ,所以 build 的时候执行 npm run build:prod 就可以了。
本文由 微wx笑 创作,采用 署名-非商业性使用-相同方式共享 4.0 许可协议,转载请附上原文出处链接及本声明。
原文链接:https://www.ivu4e.cn/blog/front/2020-12-15/575.html



