node-gyp build error windows x64

前端 未结 10 1475
情书的邮戳
情书的邮戳 2020-11-28 22:05

Here\'s what I\'ve done so far on my x64 OS:

  • Installed Python (v2.7 --specifically 2.7.6) and added it to the system path (C:\\Python27)
  • Installed MS
相关标签:
10条回答
  • 2020-11-28 22:10

    For installing node-gyp in windows or any other OS

    First you may have to download the node-gyp by

    $ npm install -g node-gyp-install
    

    Then install by

    $ npm install -g node-gyp
    

    you may need to do the above procedure as root/administrartor.

    0 讨论(0)
  • 2020-11-28 22:14

    npm config set msvs_version 2013 --global worked for me as I use VS node tools and you dont need to specify msvs_version each time you do an npm install.

    I had an issue whereby npm's config (c:\Users\username\ .npmrc) has an entry msvs_version=2012 which was out of date.

    0 讨论(0)
  • 2020-11-28 22:17

    I had this same error now in 2015 when trying to install Keystone and I ran through all you told me but it didn't work on it's own. At the end, I just had to run the command

    "C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\SetEnv.CMD" /Release /x64
    

    to set up the environment before running the command. (Don't freak out when it turns your window text green, it's working). So yeah I'd do the installations and set up environment variables in the same way everywhere on the internet suggests but make sure to run the above command before running any other command. It probably won't be useful to you, but hopefully it's useful to someone else. If that still doesn't work, MSVS version 2010 worked for me, so install that version and use the flag -msvs_version=2010 when running the npm command.

    0 讨论(0)
  • 2020-11-28 22:21

    If all above did not work (my case - Windows10 64bit)

    Delete C:\Users\user_name\.node-gyp

    Delete %AppData%/npm

    Delete %AppData%/npm-cache

    And install node-gyp again

    Following instruction on node-gyp page

    I chose Option 1 npm install --global --production windows-build-tools

    0 讨论(0)
  • 2020-11-28 22:21

    I came across this problem myself, and this is how I solved it using Visual Studio 2010:

    Install following packages

    • Python 2.7+
    • Visual C++ Studio 2010 Express
    • Windows SDK 7.1 Note: If you get error on installation, maybe this link will help you.
    • Visual Studio 2010 SP1
    • Visual C++ 2010 SP1 Compiler Update for the Windows SDK 7.1

    Use npm install from the Windows SDK command prompt (you need this because it sets additional environment variables).

    Source: node-gyp instructions for VS2010

    0 讨论(0)
  • 2020-11-28 22:21

    there is an easy to use windows build tools global node package. You could try this.

    0 讨论(0)
提交回复
热议问题