我正在尝试使用NPM为Electron项目安装Windows-Build-Tools。但是,当我运行npm install --global --production windows-build-tools
时,出现此错误:
Downloading python-2.7.15.amd64.msi
Error: getaddrinfo EAI_AGAIN www.python.org:443
Downloading Python failed. Error: { Error: getaddrinfo EAI_AGAIN www.python.org:443
at Object._errnoException (util.js:992:11)
at errnoException (dns.js:55:15)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
code: 'EAI_AGAIN',
errno: 'EAI_AGAIN',
syscall: 'getaddrinfo',
hostname: 'www.python.org',
host: 'www.python.org',
port: 443 }
windows-build-tools will now exit.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! windows-build-tools@5.1.0 postinstall: `node ./dist/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the windows-build-tools@5.1.0 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! C:\Users\blahblah\AppData\Roaming\npm-cache\_logs\2019-06-13T00_02_38_046Z-debug.log
我已经在自己的机器上安装了python 2.7.16,如果可以使用一种无需python的方式安装此软件包,我将不胜感激。
答案 0 :(得分:0)
使用镜像链接可用于安装Python:
npm --python_mirror=https://npm.taobao.org/mirrors/python/ install --global windows-build-tools
最后,这可行: github
答案 1 :(得分:0)
只需简单地使用它 它将非常顺利地工作
npm install --global --production windows-build-tools@4.0.0