leohxj
V2EX  ›  Node.js

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

  •  
  •   leohxj · Jul 1, 2014 · 17259 views
    This topic created in 4351 days ago, the information mentioned may be changed or developed.
    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 replies    2021-01-14 10:49:13 +08:00
    timonwong
        1
    timonwong  
       Jul 1, 2014   ❤️ 1
    vcbuild我记得vc2008之前才有。
    更新的强制指定吧,比如用vs2012
    npm config set msvs_version 2012 --global
    leohxj
        2
    leohxj  
    OP
       Jul 1, 2014
    @timonwong 如果要有C++编译工具,必须要通过安装VS吗?
    timonwong
        3
    timonwong  
       Jul 2, 2014
    @leohxj
    不能说是必须,只是省事。
    方便的话就只有VC,一般装Express就可以了。Windows SDK一般也行,配置和出问题的时候需要比较强的动手能力。
    coolicer
        4
    coolicer  
       Jul 2, 2014
    还是开个虚拟机跑方便。
    leohxj
        5
    leohxj  
    OP
       Jul 2, 2014
    @coolicer 我使用nodejs写了一个命令行,其中使用了jsdom库,需要依赖node-gyp。在windows下安装就需要编译,不然无法运行。。。
    efanchy
        6
    efanchy  
       Sep 30, 2015
    @timonwong 可用,我装的是 Visual Studio Express 2015 所以我运行了
    npm config set msvs_version 2015 --global
    问题已解决!感谢!
    ymwcwee
        7
    ymwcwee  
       Jan 14, 2021
    visual studio 那么庞大,真心不想安装啊
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2506 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 50ms · UTC 01:37 · PVG 09:37 · LAX 18:37 · JFK 21:37
    ♥ Do have faith in what you're doing.