请教老师,不知道为什么我的node环境突然出了问题,用npm install jest总是出错,弹出一堆错误,网上找了许久也没有解决,重装了node,和node-gyp也不行,错误信息如下:
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@14.16.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.7.4 found at "C:\Users\XXX\AppData\Local\Programs\Python\Python37\python.exe"
npm ERR! gyp http GET https://nodejs.org/download/release/v14.16.0/node-v14.16.0-headers.tar.gz
npm ERR! gyp WARN install got an error, rolling back install
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: connect ETIMEDOUT 104.20.22.46:443
npm ERR! gyp ERR! stack at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
npm ERR! gyp ERR! System Windows_NT 10.0.18363
npm ERR! gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\XXXX\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” "rebuild"
npm ERR! gyp ERR! cwd D:\XXXX\node_modules\bufferutil
npm ERR! gyp ERR! node -v v14.16.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
看提示,好像是去nodejs官网里下载源码时连接出错,node-gyp需要重新编译源码,我也下载了源码了,并在源码解压的目录下去执行了node-gyp install也是不行,不知道怎么解决好,我也不明白为什么安装一个插件就需要用到node-gyp去编译源码的,老师可以帮忙看看吗? 谢谢