NEIAPI / nei

NEI 接口管理平台 源代码
https://nei.netease.com
MIT License
318 stars 76 forks source link

请问npm install时出现问题! #8

Open ss958 opened 4 years ago

ss958 commented 4 years ago

git源码后 npm install nej -g 完成,下一步 npm install 时出现 node-gyp rebuild 卡主不动的问题。请问怎么处理? TIM截图20200424234901

huntbao commented 4 years ago

1、升级一下 Node 版本 2、npm 安装使用其他镜像试试,比如:npm install --registry=https://registry.npm.taobao.org

ss958 commented 4 years ago

谢谢 我在尝试下 有问题继续反馈,Node 版本是 v12.16.2

ss958 commented 4 years ago

实测切换国内镜像也没用。下载可以正常,只是在 node-gyp 编译环境卡主。环境 cenos7 有大神可以将编译好的依赖库上传上来么?node_modules 文件夹

huntbao commented 4 years ago

@ss958 解决了吗?这个是 Node 本身的问题。

swiich commented 3 years ago

hiredis@0.5.0 install E:\nei_\node_modules\hiredis node-gyp rebuild

E:\nei_\node_modules\hiredis>if not defined npm_config_node_gyp (node "D:\nvm\v14.0.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "D:\nvm\v14.0.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) gyp WARN install got an error, rolling back install gyp ERR! configure error gyp ERR! stack Error: read ECONNRESET gyp ERR! stack at TLSWrap.onStreamRead (internal/stream_base_commons.js:205:27) gyp ERR! System Windows_NT 10.0.18362 gyp ERR! command "C:\Program Files\nodejs\node.exe" "D:\nvm\v14.0.0\node_modules\npm\nodemodules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd E:\nei\node_modules\hiredis gyp ERR! node -v v14.0.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok

nodejieba@2.4.1 install E:\nei_\node_modules\nodejieba node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download node-pre-gyp WARN Tried to download(404): https://github.com/yanyiwu/nodejieba/releases/download/2.4.1/nodejieba-v2.4.1-node-v83-win32-x64.tar.gz node-pre-gyp WARN Pre-built binaries not found for nodejieba@2.4.1 and node@14.0.0 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)

请问为什么npm install了之后会自动执行这个gyp的命令并且失败了呢,Node版本是14.0.0

int64ago commented 3 years ago

是不是切过 Node 版本?删除 node_modules 后再试试

不行的话试试低版本 Node(同样要删除 node_modules

还是不行就试试 cnpm:

npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install
swiich commented 3 years ago

是不是切过 Node 版本?删除 node_modules 后再试试

不行的话试试低版本 Node(同样要删除 node_modules

还是不行就试试 cnpm:

npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install

E:\nei>cnpm install | [3/31] Installing koa-router@^5.4.0[koa-better-body@2.0.1 › koa-body-parsers@git+https://github.com/tunnckoCore/body-parsers.git] install koa-body-parsers from git git+https://github.com/tunnckoCore/body-parsers.git, may be very slow, please keep patience \ [12/31] Installing raw-body@^2.1.0[npminstall:runscript] koa-redis@2.1.3 › hiredis@~0.5.0 found binding.gyp file, auto run "node-gyp rebuild", root: "E:\nei\node_modules\_hiredis@0.5.0@hiredis"

E:\nei_\node_modules_hiredis@0.5.0@hiredis>node "D:\nvm\v12.18.3\node_modules\cnpm\node_modules\npminstall\node-gyp-bin\node-gyp.js" rebuild \ [14/31] Installing pinyin@^2.7.3gyp ERR! configure error gyp ERR! stack Error: Command failed: D:\Anaconda3\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack File "", line 1 gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack ^ gyp ERR! stack SyntaxError: invalid syntax gyp ERR! stack gyp ERR! stack at ChildProcess.exithandler (child_process.js:303:12) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at maybeClose (internal/child_process.js:1021:16) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) gyp ERR! System Windows_NT 10.0.18362 gyp ERR! command "C:\Program Files\nodejs\node.exe" "D:\nvm\v12.18.3\node_modules\cnpm\nodemodules\npminstall\node-gyp-bin\node-gyp.js" "rebuild" gyp ERR! cwd E:\nei\node_modules_hiredis@0.5.0@hiredis gyp ERR! node -v v12.18.3 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok [npminstall:runscript:error] koa-redis@2.1.3 › hiredis@~0.5.0 has binding.gyp file, run "node-gyp rebuild" error: Error [RunScriptError]: Run "C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild" error, exit code 1 at ChildProcess. (D:\nvm\v12.18.3\node_modules\cnpm\node_modules\runscript\index.js:96:21) at ChildProcess.emit (events.js:315:20) at maybeClose (internal/child_process.js:1021:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) { stdio: [Object], exitcode: 1 } | [14/31] Installing pinyin@^2.7.3[hiredis@~0.5.0] optional install error: RunScriptError: Run "C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild" error, exit code 1 at ChildProcess. (D:\nvm\v12.18.3\node_modules\cnpm\node_modules\runscript\index.js:96:21) at ChildProcess.emit (events.js:315:20) at maybeClose (internal/child_process.js:1021:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) | [23/31] Installing path-dirname@^1.0.0platform unsupported pm2@2.10.4 › chokidar@2.1.8 › fsevents@^1.2.7 Package require os(darwin) not compatible with your platform(win32) / [23/31] Installing tweetnacl@^0.14.3[fsevents@^1.2.7] optional install error: Package require os(darwin) not compatible with your platform(win32) \ [26/31] Installing is-buffer@^1.1.5[pm2@2.10.4 › gkt@https://tgz.pm2.io/gkt-1.0.0.tgz] install gkt from remote https://tgz.pm2.io/gkt-1.0.0.tgz, may be very slow, please keep patience \ [28/31] Installing tar@^4.4.2 WARN node unsupported "node@v12.18.3" is incompatible with mcss@0.5.1 › request@2.20.0 › hawk@~0.10.2, expected node@0.8.x

WARN node unsupported "node@v12.18.3" is incompatible with mcss@0.5.1 › request@2.20.0 › hawk@0.10.2 › sntp@0.1.x, expected node@0.8.x

WARN node unsupported "node@v12.18.3" is incompatible with mcss@0.5.1 › request@2.20.0 › hawk@0.10.2 › boom@0.3.x, expected node@0.8.x \ [29/31] Installing readable-stream@^2.0.6 WARN node unsupported "node@v12.18.3" is incompatible with mcss@0.5.1 › request@2.20.0 › hawk@0.10.2 › hoek@0.7.x, expected node@0.8.x √ Installed 31 packages √ Linked 355 latest versions [1/2] scripts.postinstall ejs@^2.5.1 run "node ./postinstall.js", root: "E:\nei_\node_modules\_ejs@2.7.4@ejs" Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)

[1/2] scripts.postinstall ejs@^2.5.1 finished in 91ms [2/2] scripts.install pinyin@2.9.1 › nodejieba@^2.2.1 run "node-pre-gyp install --fallback-to-build", root: "E:\nei_\node_modules\_nodejieba@2.4.1@nodejieba" node-pre-gyp WARN Using request for node-pre-gyp https download node-pre-gyp http GET https://github.com/yanyiwu/nodejieba/releases/download/2.4.1/nodejieba-v2.4.1-node-v72-win32-x64.tar.gz node-pre-gyp http 404 https://github.com/yanyiwu/nodejieba/releases/download/2.4.1/nodejieba-v2.4.1-node-v72-win32-x64.tar.gz node-pre-gyp WARN Tried to download(404): https://github.com/yanyiwu/nodejieba/releases/download/2.4.1/nodejieba-v2.4.1-node-v72-win32-x64.tar.gz node-pre-gyp WARN Pre-built binaries not found for nodejieba@2.4.1 and node@12.18.3 (node-v72 ABI, unknown) (falling back to source compile with node-gyp) node-pre-gyp http 404 status code downloading tarball https://github.com/yanyiwu/nodejieba/releases/download/2.4.1/nodejieba-v2.4.1-node-v72-win32-x64.tar.gz

E:\nei_\node_modules_nodejieba@2.4.1@nodejieba>node "D:\nvm\v12.18.3\node_modules\cnpm\node_modules\npminstall\node-gyp-bin\node-gyp.js" clean

E:\nei_\node_modules_nodejieba@2.4.1@nodejieba>node "D:\nvm\v12.18.3\node_modules\cnpm\nodemodules\npminstall\node-gyp-bin\node-gyp.js" configure --fallback-to-build --module=E:\nei\node_modules_nodejieba@2.4.1@nodejieba\build\Release\nodejieba.node --module_name=nodejieba --modulepath=E:\nei\node_modules_nodejieba@2.4.1@nodejieba\build\Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72 gyp ERR! configure error gyp ERR! stack Error: Command failed: D:\Anaconda3\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack File "", line 1 gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack ^ gyp ERR! stack SyntaxError: invalid syntax gyp ERR! stack gyp ERR! stack at ChildProcess.exithandler (child_process.js:303:12) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at maybeClose (internal/child_process.js:1021:16) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) gyp ERR! System Windows_NT 10.0.18362 gyp ERR! command "C:\Program Files\nodejs\node.exe" "D:\nvm\v12.18.3\node_modules\cnpm\nodemodules\npminstall\node-gyp-bin\node-gyp.js" "configure" "--fallback-to-build" "--module=E:\nei\node_modules\_nodejieba@2.4.1@nodejieba\build\Release\nodejieba.node" "--module_name=nodejieba" "--modulepath=E:\nei\node_modules\_nodejieba@2.4.1@nodejieba\build\Release" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napilabel=node-v72" gyp ERR! cwd E:\nei\nodemodules_nodejieba@2.4.1@nodejieba gyp ERR! node -v v12.18.3 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=E:\nei\node_modules_nodejieba@2.4.1@nodejieba\build\Release\nodejieba.node --module_name=nodejieba --modulepath=E:\nei\node_modules_nodejieba@2.4.1@nodejieba\build\Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napilabel=node-v72' (1) node-pre-gyp ERR! stack at ChildProcess. (E:\nei\node_modules_node-pre-gyp@0.14.0@node-pre-gyp\lib\util\compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:315:20) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) node-pre-gyp ERR! System WindowsNT 10.0.18362 node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "E:\nei\nodemodules\_node-pre-gyp@0.14.0@node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd E:\nei\nodemodules_nodejieba@2.4.1@nodejieba node-pre-gyp ERR! node -v v12.18.3 node-pre-gyp ERR! node-pre-gyp -v v0.14.0 node-pre-gyp ERR! not ok Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=E:\nei\node_modules_nodejieba@2.4.1@nodejieba\build\Release\nodejieba.node --module_name=nodejieba --modulepath=E:\nei\node_modules_nodejieba@2.4.1@nodejieba\build\Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1) [npminstall:runscript:error] pinyin@2.9.1 › nodejieba@^2.2.1 scripts.install run "node-pre-gyp install --fallback-to-build" error: Error [RunScriptError]: Run "C:\Windows\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build" error, exit code 1 at ChildProcess. (D:\nvm\v12.18.3\node_modules\cnpm\node_modules\runscript\index.js:96:21) at ChildProcess.emit (events.js:315:20) at maybeClose (internal/child_process.js:1021:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) { stdio: [Object], exitcode: 1 } pinyin@2.9.1 › nodejieba@^2.2.1 optional error: RunScriptError: Run "C:\Windows\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build" error, exit code 1 at ChildProcess. (D:\nvm\v12.18.3\node_modules\cnpm\node_modules\runscript\index.js:96:21) at ChildProcess.emit (events.js:315:20) at maybeClose (internal/child_process.js:1021:16) at Process.ChildProcess._handle.onexit (internal/childprocess.js:286:5) √ Run 2 scripts deprecate nodemailer@^2.4.1 All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/ deprecate nodemailer@2.7.2 › mailcomposer@4.0.1 This project is unmaintained deprecate nodemailer@2.7.2 › socks@1.1.9 If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0 deprecate nodemailer@2.7.2 › mailcomposer@4.0.1 › buildmail@4.0.1 This project is unmaintained deprecate request@^2.79.0 request has been deprecated, see https://github.com/request/request/issues/3142 deprecate request@2.88.2 › har-validator@~5.1.3 this library is no longer supported deprecate pm2@2.10.4 › chokidar@^2 Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. deprecate pm2@2.10.4 › mkdirp@0.5.1 Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.) deprecate pm2@2.10.4 › chokidar@2.1.8 › fsevents@^1.2.7 fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. deprecate pm2@2.10.4 › chokidar@2.1.8 › braces@2.3.2 › snapdragon@0.8.2 › source-map-resolve@0.5.3 › urix@^0.1.0 Please see https://github.com/lydell/urix#deprecated deprecate mcss@0.5.1 › mkdirp@~0.3.5 Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.) deprecate mcss@0.5.1 › request@2.20.x request has been deprecated, see https://github.com/request/request/issues/3142 deprecate mcss@0.5.1 › globule@0.1.0 › minimatch@~0.2.11 Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue deprecate mcss@0.5.1 › request@2.20.0 › node-uuid@~1.4.0 Use uuid module instead deprecate mcss@0.5.1 › globule@0.1.0 › glob@3.1.21 › graceful-fs@~1.2.0 please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js deprecate mcss@0.5.1 › request@2.20.0 › hawk@~0.10.2 This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues. deprecate mcss@0.5.1 › request@2.20.0 › hawk@0.10.2 › cryptiles@0.1.x This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). deprecate mcss@0.5.1 › request@2.20.0 › hawk@0.10.2 › sntp@0.1.x This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues. deprecate mcss@0.5.1 › request@2.20.0 › hawk@0.10.2 › boom@0.3.x This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). deprecate mcss@0.5.1 › request@2.20.0 › hawk@0.10.2 › hoek@0.7.x This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). Recently updated (since 2020-08-28): 3 packages (detail see file E:\nei\node_modules.recently_updates.txt) √ All packages installed (454 packages installed from npm registry, 1 packages installed from remote url, 1 packages installed from git, used 18s(network 12s), speed 65.16kB/s, json 384(813.1kB), tarball 0B)

试了node版本 12.18.3和 14.0.0还有8.5.0报错都是这样 好像用到了Python?我的python版本是3.7.3

python版本切换到2.7 gyp的报错会变成这样