Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CentOS下编译程序,NodeJS 环境搭建出错 #526

Closed
JasonChen-ecnu opened this issue Aug 22, 2024 · 1 comment
Closed

CentOS下编译程序,NodeJS 环境搭建出错 #526

JasonChen-ecnu opened this issue Aug 22, 2024 · 1 comment

Comments

@JasonChen-ecnu
Copy link

JasonChen-ecnu commented Aug 22, 2024

按照 #236 步骤一步步执行。安装好NodeJS 后,执行:npm install --loglevel verbose。报错。报错内容如下:

npm info run electron-winstaller@5.1.0 install node_modules/electron-winstaller node ./script/select-7z-arch.js
npm info run extract-file-icon@0.3.2 install node_modules/extract-file-icon npm run rebuild
npm info run node-window-manager@2.2.4 install node_modules/node-window-manager npm run rebuild
npm info run electron-winstaller@5.1.0 install { code: 0, signal: null }
npm info run extract-file-icon@0.3.2 install { code: 1, signal: null }
npm info run node-window-manager@2.2.4 install { code: 1, signal: null }
npm verbose stack Error: command failed
npm verbose stack at promiseSpawn (/root/.nvm/versions/node/v22.6.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:22:22)
npm verbose stack at spawnWithShell (/root/.nvm/versions/node/v22.6.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:124:10)
npm verbose stack at promiseSpawn (/root/.nvm/versions/node/v22.6.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:12:12)
npm verbose stack at runScriptPkg (/root/.nvm/versions/node/v22.6.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js:77:13)
npm verbose stack at runScript (/root/.nvm/versions/node/v22.6.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script.js:9:12)
npm verbose stack at /root/.nvm/versions/node/v22.6.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js:329:17
npm verbose stack at run (/root/.nvm/versions/node/v22.6.0/lib/node_modules/npm/node_modules/promise-call-limit/dist/commonjs/index.js:67:22)
npm verbose stack at /root/.nvm/versions/node/v22.6.0/lib/node_modules/npm/node_modules/promise-call-limit/dist/commonjs/index.js:84:9
npm verbose stack at new Promise ()
npm verbose stack at callLimit (/root/.nvm/versions/node/v22.6.0/lib/node_modules/npm/node_modules/promise-call-limit/dist/commonjs/index.js:35:69)
npm verbose pkgid extract-file-icon@0.3.2
npm error code 1
npm error path /export/EasySpider-0.6.2/ElectronJS/node_modules/extract-file-icon
npm error command failed
npm error command sh -c npm run rebuild
npm error > extract-file-icon@0.3.2 rebuild
npm error > node-gyp rebuild
npm error npm verbose cli /root/.nvm/versions/node/v22.6.0/bin/node /root/.nvm/versions/node/v22.6.0/bin/npm
npm error npm info using npm@10.8.2
npm error npm info using node@v22.6.0
npm error npm verbose title npm run rebuild
npm error npm verbose argv "run" "rebuild"
npm error npm verbose logfile logs-max:10 dir:/root/.npm/_logs/2024-08-22T10_12_02_750Z-
npm error npm verbose logfile /root/.npm/_logs/2024-08-22T10_12_02_750Z-debug-0.log
npm error gyp info it worked if it ends with ok
npm error gyp verb cli [
npm error gyp verb cli '/root/.nvm/versions/node/v22.6.0/bin/node',
npm error gyp verb cli '/export/EasySpider-0.6.2/ElectronJS/node_modules/.bin/node-gyp',
npm error gyp verb cli 'rebuild'
npm error gyp verb cli ]
npm error gyp info using node-gyp@9.4.0
npm error gyp info using node@22.6.0 | linux | x64
npm error gyp verb command rebuild []
npm error gyp verb command clean []
npm error gyp verb clean removing "build" directory
npm error gyp verb command configure []
npm error gyp verb find Python Python is not set from command line or npm configuration
npm error gyp verb find Python checking Python explicitly set from environment variable PYTHON
npm error gyp verb find Python - process.env.PYTHON is "/usr/bin/python3"
npm error gyp verb find Python - executing "/usr/bin/python3" to get executable path
npm error (node:6158) [DEP0060] DeprecationWarning: The util._extend API is deprecated. Please use Object.assign() instead.
npm error (Use node --trace-deprecation ... to show where the warning was created)
npm error gyp verb find Python - executable path is "/usr/bin/python3"
npm error gyp verb find Python - executing "/usr/bin/python3" to get version
npm error gyp verb find Python - version is "3.6.8"
npm error gyp info find Python using Python version 3.6.8 found at "/usr/bin/python3"
npm error gyp verb get node dir no --target version specified, falling back to host node version: 22.6.0
npm error gyp verb command install [ '22.6.0' ]
npm error gyp verb install input version string "22.6.0"
npm error gyp verb install installing version: 22.6.0
npm error gyp verb install --ensure was passed, so won't reinstall if already installed
npm error gyp verb install version not already installed, continuing with install 22.6.0
npm error gyp verb ensuring devDir is created /root/.cache/node-gyp/22.6.0
npm error gyp verb created devDir /root/.cache/node-gyp/22.6.0
npm error gyp http GET https://nodejs.org/download/release/v22.6.0/node-v22.6.0-headers.tar.gz
npm error gyp WARN install got an error, rolling back install
npm error gyp verb command remove [ '22.6.0' ]
npm error gyp verb remove using node-gyp dir: /root/.cache/node-gyp
npm error gyp verb remove removing target version: 22.6.0
npm error gyp verb remove removing development files for version: 22.6.0
npm error gyp ERR! configure error
npm error gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v22.6.0/node-v22.6.0-headers.tar.gz failed, reason:
npm error gyp ERR! stack at ClientRequest. (/export/EasySpider-0.6.2/ElectronJS/node_modules/minipass-fetch/lib/index.js:130:14)
npm error gyp ERR! stack at ClientRequest.emit (node:events:520:28)
npm error gyp ERR! stack at emitErrorEvent (node:_http_client:103:11)
npm error gyp ERR! stack at TLSSocket.socketErrorListener (node:_http_client:506:5)
npm error gyp ERR! stack at TLSSocket.emit (node:events:532:35)
npm error gyp ERR! stack at emitErrorNT (node:internal/streams/destroy:170:8)
npm error gyp ERR! stack at emitErrorCloseNT (node:internal/streams/destroy:129:3)
npm error gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm error gyp ERR! System Linux 4.18.0-147.el8.x86_64
npm error gyp ERR! command "/root/.nvm/versions/node/v22.6.0/bin/node" "/export/EasySpider-0.6.2/ElectronJS/node_modules/.bin/node-gyp" "rebuild"
npm error gyp ERR! cwd /export/EasySpider-0.6.2/ElectronJS/node_modules/extract-file-icon
npm error gyp ERR! node -v v22.6.0
npm error gyp ERR! node-gyp -v v9.4.0
npm error gyp ERR! not ok
npm error npm verbose cwd /export/EasySpider-0.6.2/ElectronJS/node_modules/extract-file-icon
npm error npm verbose os Linux 4.18.0-147.el8.x86_64
npm error npm verbose node v22.6.0
npm error npm verbose npm v10.8.2
npm error npm verbose exit 1
npm error npm verbose code 1
npm verbose cwd /export/EasySpider-0.6.2/ElectronJS
npm verbose os Linux 4.18.0-147.el8.x86_64
npm verbose node v22.6.0
npm verbose npm v10.8.2
npm verbose exit 1
npm verbose code 1
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-08-22T10_11_53_130Z-debug-0.log

好像是 extract-file-icon@0.3.2 和 node-window-manager@2.2.4 这两个安装失败。这个问题该如何解决

@NaiboWang
Copy link
Owner

node-window-manager在centos下不需要安装,可以直接把相关代码和依赖注释掉。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants