Uglify 中断 npm run build,日志报告没有说明任何特别的内容,npm run dev 有效 [英] Uglify breaks npm run build, log report doesn't say anything particular, npm run dev works

查看:31
本文介绍了Uglify 中断 npm run build,日志报告没有说明任何特别的内容,npm run dev 有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

This is the error message npm run build produced:

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(以及它链接到的答案),但正如您从上面的 snipper 中看到的,我的构建命令中没有 -p.

The only related problem I've been able to find was this (and the answer it links to) but as you see from the snipper above there is no -p in my build command.

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

I don't even know what Uglify is. I started with a default starter for vue (simple-webpack) and added sass functionality and a menu component that's all.

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

I can't make sense of anything in the log file but it seems to me it doesn't really point to any issue.

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 ]

请帮忙,我的智慧终于到了.

Please help, I am at the end with my wits.

推荐答案

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

Not sure what was the issue but moving the project to a different directory solved it.

这篇关于Uglify 中断 npm run build,日志报告没有说明任何特别的内容,npm run dev 有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆