首先切换淘宝源
npm config set registry http://registry.npm.taobao.org
报错1:
[Node]报错:gyp verb check python checking for Python executable "python2" in the PATH
使用管理员权限运行 PowerShell
执行 npm install --global --production windows-build-tools
报错2:
ERR! stack Error: Command failed: C:\Python310\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
// 设置config
npm config set python D:\Python27 //设置变量路径
然后再npm i就OK了