node-gyp 安装缺少 vcbuild.exe 问题

2014-07-01 22:53:34 +08:00
 leohxj
windows下安装node-gyp,会使用到vcbuild.exe编译。如果没有安装Vistual Studio的话,缺少vcbuild.exe就会报错:

MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe".


我想问问大家,你们都是怎么安装vcbuild.exe,难道和我一样,都安装了VS?
16603 次点击
所在节点    Node.js
7 条回复
timonwong
2014-07-01 23:08:14 +08:00
vcbuild我记得vc2008之前才有。
更新的强制指定吧,比如用vs2012
npm config set msvs_version 2012 --global
leohxj
2014-07-01 23:38:27 +08:00
@timonwong 如果要有C++编译工具,必须要通过安装VS吗?
timonwong
2014-07-02 08:30:53 +08:00
@leohxj
不能说是必须,只是省事。
方便的话就只有VC,一般装Express就可以了。Windows SDK一般也行,配置和出问题的时候需要比较强的动手能力。
coolicer
2014-07-02 15:28:02 +08:00
还是开个虚拟机跑方便。
leohxj
2014-07-02 22:38:00 +08:00
@coolicer 我使用nodejs写了一个命令行,其中使用了jsdom库,需要依赖node-gyp。在windows下安装就需要编译,不然无法运行。。。
efanchy
2015-09-30 11:12:14 +08:00
@timonwong 可用,我装的是 Visual Studio Express 2015 所以我运行了
npm config set msvs_version 2015 --global
问题已解决!感谢!
ymwcwee
2021-01-14 10:49:13 +08:00
visual studio 那么庞大,真心不想安装啊

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/120493

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX