centos 执行 npm run build 报错,windows 正常

提问 2 1631
catlin
catlin 2019-12-13
centos7 执行 npm run build 报错,windows 正常,各位大神,能帮忙看看什么问题么? [root@iZwz9agiqhn4s2twh2xixoZ renren-fast-vue]# npm run build > renren-fast-vue@1.2.2 build /var/lib/jenkins/workspace/renren-fast-vue > gulp [18:11:20] Using gulpfile /var/lib/jenkins/workspace/renren-fast-vue/gulpfile.js [18:11:20] Starting 'clean'... [18:11:20] Finished 'clean' after 19 ms [18:11:20] Starting 'default'... [18:11:20] Starting 'build'... [18:11:20] Finished 'default' after 21 ms ⠦ building for production...[18:12:16] 'build' errored after 56 s [18:12:16] Error in plugin "gulp-shell" Message: Command `node build/build.js` failed with exit code npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! renren-fast-vue@1.2.2 build: `gulp` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the renren-fast-vue@1.2.2 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! /root/.npm/_logs/2019-12-13T10_12_16_770Z-debug.log /root/.npm/_logs/2019-12-13T10_12_16_770Z-debug.log 打印================================以下log打印 1 verbose cli [ '/usr/local/node/node-v8.11.1-linux-x64/bin/node', 1 verbose cli '/usr/local/bin/npm', 1 verbose cli 'run', 1 verbose cli 'build' ] 2 info using npm@5.6.0 3 info using node@v8.11.1 4 verbose run-script [ 'prebuild', 'build', 'postbuild' ] 5 info lifecycle renren-fast-vue@1.2.2~prebuild: renren-fast-vue@1.2.2 6 info lifecycle renren-fast-vue@1.2.2~build: renren-fast-vue@1.2.2 7 verbose lifecycle renren-fast-vue@1.2.2~build: unsafe-perm in lifecycle true 8 verbose lifecycle renren-fast-vue@1.2.2~build: PATH: /usr/local/node/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/lib/jenkins/workspace/renren-fast-vue/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin 9 verbose lifecycle renren-fast-vue@1.2.2~build: CWD: /var/lib/jenkins/workspace/renren-fast-vue 10 silly lifecycle renren-fast-vue@1.2.2~build: Args: [ '-c', 'gulp' ] 11 silly lifecycle renren-fast-vue@1.2.2~build: Returned: code: 1 signal: null 12 info lifecycle renren-fast-vue@1.2.2~build: Failed to exec build script 13 verbose stack Error: renren-fast-vue@1.2.2 build: `gulp` 13 verbose stack Exit status 1 13 verbose stack at EventEmitter.<anonymous> (/usr/local/node/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16) 13 verbose stack at emitTwo (events.js:126:13) 13 verbose stack at EventEmitter.emit (events.js:214:7) 13 verbose stack at ChildProcess.<anonymous> (/usr/local/node/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at emitTwo (events.js:126:13) 13 verbose stack at ChildProcess.emit (events.js:214:7) 13 verbose stack at maybeClose (internal/child_process.js:925:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) 14 verbose pkgid renren-fast-vue@1.2.2 15 verbose cwd /var/lib/jenkins/workspace/renren-fast-vue 16 verbose Linux 3.10.0-957.21.3.el7.x86_64 17 verbose argv "/usr/local/node/node-v8.11.1-linux-x64/bin/node" "/usr/local/bin/npm" "run" "build" 18 verbose node v8.11.1 19 verbose npm v5.6.0 20 error code ELIFECYCLE 21 error errno 1 22 error renren-fast-vue@1.2.2 build: `gulp` 22 error Exit status 1 23 error Failed at the renren-fast-vue@1.2.2 build script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]
回帖
  • 升级nodejs到10试试
    0 回复
  • catlin
    catlin (楼主)
    2019-12-23
    @Mark 还是不行,升完级又报错了 [root@iZwz9agiqhn4s2twh2xixoZ renren-fast-vue]# vim /root/.npm/_logs/2019-12-23T10_27_55_336Z-debug.log 0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/node/node-v10.16.2-linux-x64/bin/node', 1 verbose cli '/usr/local/bin/npm', 1 verbose cli 'run', 1 verbose cli 'build' ] 2 info using npm@6.9.0 3 info using node@v10.16.2 4 verbose run-script [ 'prebuild', 'build', 'postbuild' ] 5 info lifecycle renren-fast-vue@1.2.2~prebuild: renren-fast-vue@1.2.2 6 info lifecycle renren-fast-vue@1.2.2~build: renren-fast-vue@1.2.2 7 verbose lifecycle renren-fast-vue@1.2.2~build: unsafe-perm in lifecycle true 8 verbose lifecycle renren-fast-vue@1.2.2~build: PATH: /usr/local/node/node-v10.16.2-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/lib/jenkins/workspace/renren-fast-vue/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin 9 verbose lifecycle renren-fast-vue@1.2.2~build: CWD: /var/lib/jenkins/workspace/renren-fast-vue 10 silly lifecycle renren-fast-vue@1.2.2~build: Args: [ '-c', 'gulp' ] 11 silly lifecycle renren-fast-vue@1.2.2~build: Returned: code: 1 signal: null 12 info lifecycle renren-fast-vue@1.2.2~build: Failed to exec build script 13 verbose stack Error: renren-fast-vue@1.2.2 build: `gulp` 13 verbose stack Exit status 1 13 verbose stack at EventEmitter.<anonymous> (/usr/local/node/node-v10.16.2-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16) 13 verbose stack at EventEmitter.emit (events.js:198:13) 13 verbose stack at ChildProcess.<anonymous> (/usr/local/node/node-v10.16.2-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:198:13) 13 verbose stack at maybeClose (internal/child_process.js:982:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) 14 verbose pkgid renren-fast-vue@1.2.2 15 verbose cwd /var/lib/jenkins/workspace/renren-fast-vue 16 verbose Linux 3.10.0-957.21.3.el7.x86_64 17 verbose argv "/usr/local/node/node-v10.16.2-linux-x64/bin/node" "/usr/local/bin/npm" "run" "build" 18 verbose node v10.16.2 19 verbose npm v6.9.0 20 error code ELIFECYCLE 21 error errno 1 22 error renren-fast-vue@1.2.2 build: `gulp` 22 error Exit status 1 23 error Failed at the renren-fast-vue@1.2.2 build script. 23 error This is probably not a problem with npm. There is likely additional logging output above.
    0 回复