处理使用node-gpy时遇到的Can't find "msbuild.exe"错误
来源:互联网 发布:手机地图导航软件 编辑:程序博客网 时间:2024/06/15 15:18
在Windows中使用node-gpy编译Node.js C++原生扩展时,需要使用Visual Studio C++的"msbuild.exe"。有时尽管Visual Studio安装运行正常,在调用node-gyp时仍会遇到找不到"msbuild.exe"的错误提示:
Error: Can't find "msbuild.exe". Do you have Mircrosoft Visual Studio C++ 2008+ instlled?
node-gpy在搜索"msbuild.exe"时,是通过查询Windows注册表,提取Visual Studio C++版本号来获取"msbuild.exe"安装路径。出现上述运行错误的原因之一就是node-gpy查询Windows注册表出现差错。node-gpy查询Windows注册表的脚本代码在
C:\Users\abc\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js
其中"abc"为当前用户名。 具体代码如下:
function findMsbuild () { log.verbose('could not find "msbuild.exe" in PATH - finding location in registry') var notfoundErr = new Error('Can\'t find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?') var cmd = 'reg query "HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions" /s'
其中最后一行语句即为运行出错代码。如代码所示,node-gpy通过调用"reg.exe"查询Windows注册表。node-gpy的脚本代码中没有设置"reg.exe"路径。 "reg.exe"一般保存在'C:\\Windows\\System32\\'文件夹中,将这行代码做如下修改:
var cmd = 'C:\\Windows\\System32\\reg.exe query "HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions" /s'node-gpy就能获取"msbuild.exe"的安装路径。
2 0
- 处理使用node-gpy时遇到的Can't find "msbuild.exe"错误
- 安装node-sass时,遇到的错误MSBUILD: error MSB3428 Visual C++ VCBuild.exe 1) .NET Framework 2.0 SDK Microsoft
- gridview导出exe处理时遇到RegisterForEventValidation can only be called during Render();错误
- iOS使用一些特殊键盘时的运行错误解决Can't find keyplane that supports type 4 for keyboard
- Centos7 安装dns服务named时,遇到的** server can't find xxx.com: NXDOMAIN问题
- 使用swagger 遇到 Can't read swagger JSON 错误
- (四)electron尝试使用win32 API——node-gpy到底是干嘛的?
- 遇到Can\'t find file : \'./mc2db/job_list.frm\' <errno: 13>错误
- VS2012 can't find localized resources错误
- python脚本处理文本时遇到的字符问题:UnicodeDecodeError: " " codec can't decode byte
- Can't find bundle for base name javax.servlet.LocalStrings, locale zh_CN错误处理
- 安装node.js和npm推荐版本的报错 can't find the npmlog file
- 遇到的错误-----MySQL使用临时表 出现 “ERROR 1137 (HY000): Can't reopen table” 的异常 解决方法
- redis 集群搭建 遇到的问题 Sorry, can't connect to node 127.0.0.1:7000
- Can't find data drive! 在安装5u中遇到的问题
- Cxf开发webservice时遇到Can't find the request for xx's Observer
- 关于react-native遇到Can't find variable: TouchableHighlight
- 解决can't find -lGL的问题
- The recycle times and the feature of the top grade dynea brown film faced plywood
- 线程最最基本的操作1,(用到了waitforsinglobject)
- Memcached保存sesion数据的方法以及安全性问题
- Socket服务器端
- CABasicAnimation介绍
- 处理使用node-gpy时遇到的Can't find "msbuild.exe"错误
- Android学习笔记之----浅析Android进程与线程
- 网络框架Volley
- float与double的范围和精度
- Android中连接服务器
- c/c++启动函数startup
- LBP算子
- Java语言基础(一)---关键字、标识符、注释、常量、变量、运算符
- poj 2516