node.js - Windows-build-tools 安装
问题描述
Windows 10,Node - v12.17.0,NPM - 6.14.4,Node-gyp - v7.1.0
我尝试安装 windows-build-tools : $npm install -g windows-build-tools
这是错误:
$npm install -g windows-build-tools
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
> windows-build-tools@5.2.2 postinstall C:\Users\SSD\AppData\Roaming\npm\node_modules\windows-build-tools
> node ./dist/index.js
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn C:\Windows\system32\cmd.exe;C:\Program Files\Git\cmd\;C:\Users\SSD\AppData\Roaming\Python\Python38\Scripts;
npm ERR! file C:\Windows\system32\cmd.exe;C:\Program Files\Git\cmd\;C:\Users\SSD\AppData\Roaming\Python\Python38\Scripts;
npm ERR! path C:\Windows\system32\cmd.exe;C:\Program Files\Git\cmd\;C:\Users\SSD\AppData\Roaming\Python\Python38\Scripts;
npm ERR! errno ENOENT
npm ERR! windows-build-tools@5.2.2 postinstall: `node ./dist/index.js`
npm ERR! spawn C:\Windows\system32\cmd.exe;C:\Program Files\Git\cmd\;C:\Users\SSD\AppData\Roaming\Python\Python38\Scripts; ENOENT
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:
这是我的系统环境路径:
C:\Users\SSD\AppData\Roaming\npm
C:\Program Files\Git\cmd
C:\Program Files\nodejs
C:\Users\SSD\AppData\Local\Programs\Python\Python38-32
C:\Users\SSD\AppData\Local\Programs\Python\Python38-32\Scripts
C:\Program Files\Git\bin
这是我的系统环境 CompSpec:
%SystemRoot%\system32\cmd.exe
C:\Program Files\Git\cmd\
C:\Users\SSD\AppData\Roaming\Python\Python38\Scripts
解决方案
@unamen尝试编辑环境路径变量
您当前的环境变量
C:\Users\SSD\AppData\Roaming\npm
C:\Program Files\Git\cmd
C:\Program Files\nodejs
C:\Users\SSD\AppData\Local\Programs\Python\Python38-32
C:\Users\SSD\AppData\Local\Programs\Python\Python38-32\Scripts
C:\Program Files\Git\bin
更新的环境变量
C:\Program Files\nodejs\
C:\Users\SSD\AppData\Roaming\npm
C:\Program Files\Git\cmd
C:\Users\SSD\AppData\Local\Programs\Python\Python38-32
C:\Users\SSD\AppData\Local\Programs\Python\Python38-32\Scripts
C:\Program Files\Git\bin
推荐阅读
- android - 为 iOS 和 Android 提供不同的 Progressive Web App UI
- sql - Compare numerically in varchar column
- android - 从 google Play Store 获取应用用户信息
- docker - 将 ansible 应用程序安装到 docker 容器
- javascript - 在填充数组项上的映射函数似乎为空之后
- jquery - vue.js 中的 jquery 方法实现
- r - 计算 R 中特殊列的 RMSE
- c - 如何将整数值插入到 uint64_t 之类的rocksdb?
- java - TreeSet 的类转换异常问题
- vue.js - Can I variably choose what Vue.js component to use in a template?