Open ss958 opened 4 years ago
1、升级一下 Node 版本
2、npm 安装使用其他镜像试试,比如:npm install --registry=https://registry.npm.taobao.org
谢谢 我在尝试下 有问题继续反馈,Node 版本是 v12.16.2
实测切换国内镜像也没用。下载可以正常,只是在 node-gyp 编译环境卡主。环境 cenos7 有大神可以将编译好的依赖库上传上来么?node_modules 文件夹
@ss958 解决了吗?这个是 Node 本身的问题。
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
是不是切过 Node 版本?删除 node_modules
后再试试
不行的话试试低版本 Node(同样要删除 node_modules
)
还是不行就试试 cnpm:
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install
是不是切过 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 "
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 "
试了node版本 12.18.3和 14.0.0还有8.5.0报错都是这样 好像用到了Python?我的python版本是3.7.3
python版本切换到2.7 gyp的报错会变成这样
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (D:\nvm\v12.18.3\node_modules\cnpm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at emitTwo (events.js:125:13)
gyp ERR! stack at ChildProcess.emit (events.js:213:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
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 v8.5.0
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.
git源码后 npm install nej -g 完成,下一步 npm install 时出现 node-gyp rebuild 卡主不动的问题。请问怎么处理?![TIM截图20200424234901](https://user-images.githubusercontent.com/29692005/80231852-8e569500-8686-11ea-936e-420fa45071bd.png)