Closed Zzz233 closed 2 years ago
不要使用 root 运行
不要使用 root 运行
切换到非root用户后执行 npm install
electron@16.0.1 postinstall /home/bdo/poi/node_modules/electron node install.js
Downloading electron-v16.0.1-linux-x64.zip: [----------------------------------------------------------------------------------------------------] 0% ETA: 0.0 sDownloading electron-v16.0.1-linux-x64.zip: [------Downloading electron-v16.0.1-linux-x64.zip: [=---------------------------------------------------------------Downloading electron-v16.0.1-linux-x64.zip: [===========] 100% ETA: 0.0 seconds Error: Generated checksum for "electron-v16.0.1-linux-x64.zip" did not match expected checksum. at Hash.hasher.on (/home/bdo/poi/nodemodules/sumchecker/index.js:133:20) at Hash.emit (events.js:198:13) at emitReadable (_stream_readable.js:555:12) at process._tickCallback (internal/process/next_tick.js:63:19) [ ......] - postinstall: info lifecycle electron@16.0.1~postinstall: [ ......] - postinstall: info lifecycle electron@16.0.1~postinstall: npm WARN postcss-safe-parser@6.0.0 requires a peer of postcss@^8.3.3 but none is installed. You must install peer dependencies yourself. npm WARN react-ultimate-pagination@1.2.0 requires a peer of react@^0.14.0 || ^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself. npm WARN react-ultimate-pagination@1.2.0 requires a peer of react-dom@^0.14.0 || ^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself. npm WARN react-virtualized@9.22.3 requires a peer of react@^15.3.0 || ^16.0.0-alpha but none is installed. You must install peer dependencies yourself. npm WARN react-virtualized@9.22.3 requires a peer of react-dom@^15.3.0 || ^16.0.0-alpha but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/@types/gulp/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/jest-haste-map/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: iconv-corefoundation@1.1.6 (node_modules/iconv-corefoundation): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for iconv-corefoundation@1.1.6: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: dmg-license@1.0.9 (node_modules/dmg-license): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for dmg-license@1.0.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@16.0.1 postinstall: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron@16.0.1 postinstall 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! /home/bdo/.npm/_logs/2021-12-09T06_42_18_409Z-debug.log
看起来像是没有完整下载,可以使用中国地区镜像 ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/" npm i
看起来像是没有完整下载,可以使用中国地区镜像
ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/" npm i
poi@10.7.0 start /home/bdo/poi electron .
No protocol specified
/home/bdo/poi/node_modules/electron/dist/electron exited with signal SIGTRAP
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! poi@10.7.0 start: electron .
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the poi@10.7.0 start 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! /home/bdo/.npm/_logs/2021-12-09T07_21_23_333Z-debug.log
谢谢大神的耐心帮助
看起来权限上还是用 su 安装的,你试试看把 node_modules 删除然后用非 su 的用户重新运行一次 npm i
看起来权限上还是用 su 安装的,你试试看把 node_modules 删除然后用非 su 的用户重新运行一次
npm i
[bdo@192 poi]$ npm start
poi@10.7.0 start /home/bdo/poi electron .
Invalid MIT-MAGIC-COOKIE-1 key/home/bdo/poi/node_modules/electron/dist/electron exited with signal SIGTRAP
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! poi@10.7.0 start: electron .
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the poi@10.7.0 start 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! /home/bdo/.npm/_logs/2021-12-09T09_16_01_330Z-debug.log
执行 npm install 后
npm WARN lifecycle poi@10.7.0~prepare: cannot run in wd poi@10.7.0 husky install (wd=/usr/games/poi) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: dmg-license@1.0.9 (node_modules/dmg-license): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for dmg-license@1.0.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/jest-haste-map/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/@types/gulp/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 2061 packages from 1139 contributors and audited 2093 packages in 25.862s
144 packages are looking for funding run
npm fund
for detailsfound 12 vulnerabilities (11 moderate, 1 high) run
npm audit fix
to fix them, ornpm audit
for details就此继续执行 npm start
[1209/113100.305003:FATAL:electron_main_delegate.cc(290)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180. /usr/games/poi/node_modules/electron/dist/electron exited with signal SIGTRAP npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! poi@10.7.0 start:
electron .
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the poi@10.7.0 start 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/2021-12-09T03_31_00_626Z-debug.log
萌新求助
2021-12-09T03_31_00_626Z-debug.log 里面的内容
0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/node', '/bin/npm', 'start' ] 2 info using npm@6.14.11 3 info using node@v10.24.0 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle poi@10.7.0~prestart: poi@10.7.0 6 info lifecycle poi@10.7.0~start: poi@10.7.0 7 verbose lifecycle poi@10.7.0~start: unsafe-perm in lifecycle true 8 verbose lifecycle poi@10.7.0~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/games/poi/node_modules/.bin:/opt/Python/Python-3.6.5/bin:/opt/Python/Python-3.6.5/bin:/opt/Python/Python-3.6.5/bin:/usr/local/sbin:/usr/sbin:/sbin:/bin:/usr/bin:/usr/local/bin:/root/.dotnet/tools:/usr/local/mycat/bin:/root/bin:/usr/local/mycat/bin:/root/bin:/usr/local/mycat/bin:/root/bin 9 verbose lifecycle poi@10.7.0~start: CWD: /usr/games/poi 10 silly lifecycle poi@10.7.0~start: Args: [ '-c', 'electron .' ] 11 silly lifecycle poi@10.7.0~start: Returned: code: 1 signal: null 12 info lifecycle poi@10.7.0~start: Failed to exec start script 13 verbose stack Error: poi@10.7.0 start: (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess. (/usr/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 poi@10.7.0
15 verbose cwd /usr/games/poi
16 verbose Linux 4.18.0-240.el8.x86_64
17 verbose argv "/usr/bin/node" "/bin/npm" "start"
18 verbose node v10.24.0
19 verbose npm v6.14.11
20 error code ELIFECYCLE
21 error errno 1
22 error poi@10.7.0 start:
electron .
13 verbose stack Exit status 1 13 verbose stack at EventEmitter.electron .
22 error Exit status 1 23 error Failed at the poi@10.7.0 start script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]