这是一个创建于 1730 天前的主题,其中的信息可能已经有所发展或是发生改变。
npm run start 是正常的
1.尝试过 delete package-lock.json & node_modules and then rerun npm install and npm run build.
2.猜测是 CSS 编译错误
npm ERR! errno 1
npm ERR! socialsport@1.0.0 build: `node build/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the socialsport@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\cai_e\AppData\Roaming\npm-cache\_logs\2020-05-31T15_56_35_023Z-debug.log
详细 log
0 info it worked if it ends with ok
1 verbose cli [ 'D:\\nodeJs\\node.exe',
1 verbose cli 'D:\\nodeJs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build' ]
2 info using npm@6.4.1
3 info using node@v10.15.3
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle socialsport@1.0.0~prebuild: socialsport@1.0.0
6 info lifecycle socialsport@1.0.0~build: socialsport@1.0.0
7 verbose lifecycle socialsport@1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle socialsport@1.0.0~build: PATH: D:\nvm\v10.15.3\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\social\web\node_modules\.bin;D:\Xshell 6\;D:\Python3\Scripts\;D:\Python3\;C:\Program Files (x86)\Razer\ChromaBroadcast\bin;C:\Program Files\Razer\ChromaBroadcast\bin;C:\Program Files (x86)\Razer Chroma SDK\bin;C:\Program Files\Razer Chroma SDK\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;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:\Users\cai_e\AppData\Local\Microsoft\WindowsApps;E:\work\erl8.1\bin;D:\TortoiseSVN\bin;E:\work\Git\cmd;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;D:\TortoiseGit\bin;D:\nvm;D:\nodeJs;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\cai_e\AppData\Local\Programs\Python\Python37\Scripts\;C:\Users\cai_e\AppData\Local\Programs\Python\Python37\;C:\Users\cai_e\AppData\Local\Microsoft\WindowsApps;D:\Microsoft VS Code\bin;C:\Users\cai_e\AppData\Local\GitHubDesktop\bin;D:\nvm;D:\nodeJs;C:\Program Files\MySQL\MySQL Server 8.0\bin;
9 verbose lifecycle socialsport@1.0.0~build: CWD: D:\social\web
10 silly lifecycle socialsport@1.0.0~build: Args: [ '/d /s /c', 'node build/build.js' ]
11 silly lifecycle socialsport@1.0.0~build: Returned: code: 1 signal: null
12 info lifecycle socialsport@1.0.0~build: Failed to exec build script
13 verbose stack Error: socialsport@1.0.0 build: `node build/build.js`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (D:\nvm\v10.15.3\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:189:13)
13 verbose stack at ChildProcess.<anonymous> (D:\nvm\v10.15.3\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:189:13)
13 verbose stack at maybeClose (internal/child_process.js:970:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid socialsport@1.0.0
15 verbose cwd D:\social\web
16 verbose Windows_NT 10.0.18362
17 verbose argv "D:\\nodeJs\\node.exe" "D:\\nodeJs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v10.15.3
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error socialsport@1.0.0 build: `node build/build.js`
22 error Exit status 1
23 error Failed at the socialsport@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 ]
第 1 条附言 · 2020-06-01 00:37:45 +08:00
Vue 项目打包成移动端 APP
在 npm run build 一直提示报错.
因为 npm run start 是正常,网页上测试也可以
错误信息就贴到上面了.
看过 issues 建议是清理 package-lock.json & node_modules
各大网站都找了快 1 小时了.
后面检查到 css 异常
其实还是没懂怎么看这个错误日志
3 条回复 • 2020-06-01 00:38:15 +08:00
 |
|
1
ecai 2020-06-01 00:08:50 +08:00
一个一个 CSS 的排除,找到了
|
 |
|
2
MuscleOf2016 2020-06-01 00:28:07 +08:00
虽然帖子发的不怎么样,还是支持下自己解决问题,一定很开心吧。
|
 |
|
3
ecai 2020-06-01 00:38:15 +08:00
@ MuscleOf2016 :) 哈哈,当时很急,到处都看了. 就随手把错误贴上来了. 等我后面修正一下
|