我尝试运行npm run build
输出低于错误:
root@tim-VPCEB42EG:/home/tavinder/es6# npm run build
npm ERR! Linux 4.15.0-39-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "build"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! missing script: build
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/tavinder/es6/npm-debug.log
答案 0 :(得分:0)
这意味着您缺少脚本。当执行该命令时,NPM应该知道要运行哪个脚本。如果您有构建脚本,请在package.json中的脚本下:
"scripts": {
"test": "jest"
"build": "name of your build script"
},
例如,在我的一个项目中,
"scripts": {
"lint": "./node_modules/.bin/eslint .",
"lint:fix": "./node_modules/.bin/eslint . --fix || true",
"build": "babel src -d dist --presets es2015",
.....
}
答案 1 :(得分:0)