Uglify breaks npm run build, log report doesn'

2019-02-20 14:11发布

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]

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.

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.

1条回答
Root(大扎)
2楼-- · 2019-02-20 14:43

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

查看更多
登录 后发表回答