2.9.0版本打包有问题
最近才开始学习vue,在使用2.9.0版本进行打包的时候发现一直报以下错误
ERROR in Encountered an error while minifying static/js/app.d1db499be83602bad39c.js: SyntaxError: Unexpected token: keyword «const» 23 | } 24 | // Vue.extend constructor export interop.
25 | const options = typeof script === 'function' ? script.options : script; | ^ 26 | // render functions 27 | if (template && template.render) { 28 | options.render = template.render;
Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: node build/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\AppData\Roaming\npm-cache_logs\2020-04-08T17_55_49_539Z-debug.log
log文件内容是:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]~prebuild: [email protected]
6 info lifecycle [email protected]~build: [email protected]
10 silly lifecycle [email protected]~build: Args: [ '/d /s /c', 'node build/build.js' ]
11 silly lifecycle [email protected]~build: Returned: code: 1 signal: null
12 info lifecycle [email protected]~build: Failed to exec build script
13 verbose stack Error: [email protected] build: node build/build.js
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.node build/build.js
22 error Exit status 1
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
检查了好久, 也添加了babel-loader, 依旧不行 最后更换为2.8.1版本, 可以正常打包
因为隐私问题, 日志中涉及个人信息的部分已经隐藏
vue版本2.9.6