提款机里的一元钱
2021-10-12 15:48
采纳率: 100%
浏览 47

react 项目打包的时候报错Unexpected token: punc ()) [index.js:20434,18]

img


Creating an optimized production build...
Failed to compile.

index.js from UglifyJs
Unexpected token: punc ()) [index.js:20434,18]

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! haier-gsop@1.0.0 build: `roadhog build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the haier-gsop@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\wenlong\AppData\Roaming\npm-cache\_logs\2021-10-12T07_36_33_012Z-debug.log
npm ERR!     C:\Users\wenlong\AppData\Roaming\npm-cache\_logs\2021-10-12T07_36_33_012Z-debug.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 haier-gsop@1.0.0~prebuild: haier-gsop@1.0.0
6 info lifecycle haier-gsop@1.0.0~build: haier-gsop@1.0.0
7 verbose lifecycle haier-gsop@1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle haier-gsop@1.0.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\paoject1\mplm-ui\node_modules\.bin;D:\VMware Workstation Pro\bin\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\VisualSVN Server\bin;C:\Program Files\Git\cmd;C:\Program Files (x86)\Yarn\bin\;C:\Program Files\nodejs\;D:\Microsoft VS Code\bin;C:\Users\wenlong\AppData\Local\Microsoft\WindowsApps;D:\Microsoft VS Code\bin;C:\PHPnow\MySQL-5.1.50\bin;C:\Users\wenlong\AppData\Local\Yarn\bin;C:\Program Files\MongoDB\Server\4.2\bin;;D:\WebStorm 2020.3.3\bin;;C:\Users\wenlong\AppData\Roaming\npm
9 verbose lifecycle haier-gsop@1.0.0~build: CWD: D:\paoject1\mplm-ui
10 silly lifecycle haier-gsop@1.0.0~build: Args: [ '/d /s /c', 'roadhog build' ]
11 silly lifecycle haier-gsop@1.0.0~build: Returned: code: 1  signal: null
12 info lifecycle haier-gsop@1.0.0~build: Failed to exec build script
13 verbose stack Error: haier-gsop@1.0.0 build: `roadhog build`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (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.<anonymous> (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)
14 verbose pkgid haier-gsop@1.0.0
15 verbose cwd D:\paoject1\mplm-ui
16 verbose Windows_NT 10.0.18363
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 haier-gsop@1.0.0 build: `roadhog build`
22 error Exit status 1
23 error Failed at the haier-gsop@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 ]


2条回答 默认 最新

相关推荐 更多相似问题