【问题标题】:Uglify breaks npm run build, log report doesn't say anything particular, npm run dev worksUglify 中断 npm run build,日志报告没有说明任何具体内容,npm run dev 有效
【发布时间】:2018-10-23 11:25:13
【问题描述】:

这是 npm run build 产生的错误信息:

ERROR in build.js from UglifyJs
Unexpected token: punc (() [src/App.vue:40,0][build.js:139,6]
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! poc3@1.0.0 build: `cross-env NODE_ENV=production 
webpack --hide-modules`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the poc3@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:
[log file]

我能找到的唯一相关问题是this(以及它链接到的答案),但正如您从上面的截图中看到的那样,我的构建命令中没有-p

我什至不知道 Uglify 是什么。我从 vue 的默认启动器 (simple-webpack) 开始,然后添加了 sass 功能和菜单组件。

我无法理解日志文件中的任何内容,但在我看来它并没有真正指出任何问题。

13 verbose stack Error: poc3@1.0.0 build: `cross-env NODE_ENV=production webpack --hide-modules`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:182:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:182:13)
13 verbose stack     at maybeClose (internal/child_process.js:962:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
14 verbose pkgid FutureTheoryLP@1.0.0
15 verbose cwd /Users/path/poc3
16 verbose Darwin 16.7.0
17 verbose argv "/usr/local/Cellar/node/7.10.0/bin/node" "/usr/local/bin/npm" "run" "build"
18 verbose node v10.12.0
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 2
22 error FutureTheoryLP@1.0.0 build: `cross-env NODE_ENV=production webpack --hide-modules`
22 error Exit status 2
23 error Failed at the poc3@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 [ 2, true ]

请帮忙,我的智慧在最后。

【问题讨论】:

    标签: vue.js webpack vuejs2


    【解决方案1】:

    不确定是什么问题,但将项目移动到其他目录解决了它。

    【讨论】:

      猜你喜欢
      • 2018-09-22
      • 2023-01-03
      • 2021-03-26
      • 1970-01-01
      • 2021-11-22
      • 2018-06-20
      • 2021-01-31
      • 2020-11-17
      • 2023-02-03
      相关资源
      最近更新 更多