npm run build无法打包的可能原因 npm ERR! missing script: build

结果报错npm ERR! missing script: build,后来发现package.json中scripts参数为
"scripts": {

"dev": "vue-cli-service serve",

"build:prod": "vue-cli-service build",

"build:stage": "vue-cli-service build --mode staging",

"preview": "node build/index.js --preview",

"lint": "eslint --ext .js,.vue src",

"test:unit": "jest --clearCache && vue-cli-service test:unit",

"test:ci": "npm run lint && npm run test:unit",

"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"

},

 

 

所以正确的命令应该为

npm run build:prod --report


 

posted @ 2020-05-16 13:51  开源  阅读(2381)  评论(0编辑  收藏  举报