vue发布报错 verbose stack Error: missing script: build
0infoitworkedifitendswithok1verbosecli[1verbosecli'C:\\ProgramFiles\\nodejs\\node.exe',1verbosecli'C:\\ProgramFiles\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',1verbosecli'run',1verbosecli'build'1ver
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\ProgramFiles\\nodejs\\node.exe',
1 verbose cli 'C:\\ProgramFiles\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build'
1 verbose cli ]
2 info using npm@6.14.4
3 info using node@v12.17.0
4 verbose stack Error: missing script: build
4 verbose stack at run (C:\ProgramFiles\nodejs\node_modules\npm\lib\run-script.js:155:19)
4 verbose stack at C:\ProgramFiles\nodejs\node_modules\npm\lib\run-script.js:63:5
4 verbose stack at C:\ProgramFiles\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:116:5
4 verbose stack at C:\ProgramFiles\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:436:5
4 verbose stack at checkBinReferences_ (C:\ProgramFiles\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:391:45)
4 verbose stack at final (C:\ProgramFiles\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:434:3)
4 verbose stack at then (C:\ProgramFiles\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:161:5)
4 verbose stack at C:\ProgramFiles\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:281:12
4 verbose stack at C:\ProgramFiles\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:115:16
4 verbose stack at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3)
5 verbose cwd D:\code\vue\vue-simple-master\vue-simple-master
6 verbose Windows_NT 10.0.18363
7 verbose argv "C:\\ProgramFiles\\nodejs\\node.exe" "C:\\ProgramFiles\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
8 verbose node v12.17.0
9 verbose npm v6.14.4
10 error missing script: build
11 verbose exit [ 1, true ]
解决方法
首先试了
webpack -v
npm install webpack -g
以上没有解决,用以下方法
npm run build:prod --report
原因是package.json的scripts中:"build:prod"
"scripts": {
"dev": "cross-env NODE_ENV=development env_config=dev node build/dev-server.js",
"build:sit": "cross-env NODE_ENV=production env_config=sit node build/build.js",
"build:uat": "cross-env NODE_ENV=production env_config=uat node build/build.js",
"build:prod": "cross-env NODE_ENV=production env_config=prod node build/build.js",
"lint-fix": "eslint --ext .js,.vue src --fix .js,.vue src",
"lint": "eslint --ext .js,.vue src",
"precommit": "lint-staged"
}
更多推荐
所有评论(0)