CyberNika / v-contextmenu

🖱 ContextMenu based on Vue 3 & Vue 2
https://cybernika.github.io/v-contextmenu/
MIT License
918 stars 112 forks source link

2.9.0版本打包有问题 #77

Open ZHBingo opened 4 years ago

ZHBingo commented 4 years ago

最近才开始学习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! scp-ui@1.0.0 build: node build/build.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the scp-ui@1.0.0 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 npm@6.13.4 3 info using node@v12.16.0 4 verbose run-script [ 'prebuild', 'build', 'postbuild' ] 5 info lifecycle scp-ui@1.0.0~prebuild: scp-ui@1.0.0 6 info lifecycle scp-ui@1.0.0~build: scp-ui@1.0.0 10 silly lifecycle scp-ui@1.0.0~build: Args: [ '/d /s /c', 'node build/build.js' ] 11 silly lifecycle scp-ui@1.0.0~build: Returned: code: 1 signal: null 12 info lifecycle scp-ui@1.0.0~build: Failed to exec build script 13 verbose stack Error: scp-ui@1.0.0 build: node build/build.js 13 verbose stack Exit status 1 13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16) 13 verbose stack at EventEmitter.emit (events.js:321:20) 13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:321:20) 13 verbose stack at maybeClose (internal/child_process.js:1021:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) 16 verbose Windows_NT 10.0.18362 17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "build" 18 verbose node v12.16.0 19 verbose npm v6.13.4 20 error code ELIFECYCLE 21 error errno 1 22 error scp-ui@1.0.0 build: node build/build.js 22 error Exit status 1 23 error Failed at the scp-ui@1.0.0 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