执行
npm install --global --vs2019 --production windows-build-tools
报一下错误信息
Downloading python-2.7.15.amd64.msi
Downloading Python failed. Error: Error: getaddrinfo ENOTFOUND cdn.npmmirror.com
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) {
errno: -3008,
code: ‘ENOTFOUND’,
syscall: ‘getaddrinfo’,
hostname: ‘cdn.npmmirror.com’
}
windows-build-tools will now exit.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! windows-build-tools@5.2.2 postinstall: node ./dist/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the windows-build-tools@5.2.2 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! D:\websoftware\nodeJS\nodejs\node_cache_logs\2023-01-06T09_07_41_306Z-debug.log
解决办法
cmd——右键——“管理员身份运行”