V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
leohxj
V2EX  ›  Node.js

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

  •  
  •   leohxj · 2014-07-01 22:53:34 +08:00 · 16581 次点击
    这是一个创建于 3589 天前的主题,其中的信息可能已经有所发展或是发生改变。
    windows下安装node-gyp,会使用到vcbuild.exe编译。如果没有安装Vistual Studio的话,缺少vcbuild.exe就会报错:

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


    我想问问大家,你们都是怎么安装vcbuild.exe,难道和我一样,都安装了VS?
    7 条回复    2021-01-14 10:49:13 +08:00
    timonwong
        1
    timonwong  
       2014-07-01 23:08:14 +08:00   ❤️ 1
    vcbuild我记得vc2008之前才有。
    更新的强制指定吧,比如用vs2012
    npm config set msvs_version 2012 --global
    leohxj
        2
    leohxj  
    OP
       2014-07-01 23:38:27 +08:00
    @timonwong 如果要有C++编译工具,必须要通过安装VS吗?
    timonwong
        3
    timonwong  
       2014-07-02 08:30:53 +08:00
    @leohxj
    不能说是必须,只是省事。
    方便的话就只有VC,一般装Express就可以了。Windows SDK一般也行,配置和出问题的时候需要比较强的动手能力。
    coolicer
        4
    coolicer  
       2014-07-02 15:28:02 +08:00
    还是开个虚拟机跑方便。
    leohxj
        5
    leohxj  
    OP
       2014-07-02 22:38:00 +08:00
    @coolicer 我使用nodejs写了一个命令行,其中使用了jsdom库,需要依赖node-gyp。在windows下安装就需要编译,不然无法运行。。。
    efanchy
        6
    efanchy  
       2015-09-30 11:12:14 +08:00
    @timonwong 可用,我装的是 Visual Studio Express 2015 所以我运行了
    npm config set msvs_version 2015 --global
    问题已解决!感谢!
    ymwcwee
        7
    ymwcwee  
       2021-01-14 10:49:13 +08:00
    visual studio 那么庞大,真心不想安装啊
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1162 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 18:19 · PVG 02:19 · LAX 11:19 · JFK 14:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.