node-gyp build error windows x64

Solution 1:

I had a similar problem. I found that this switch helped me

--msvs_version=2012

so for example

npm install --msvs_version=2012 <package>

Solution 2:

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.

Solution 3:

After spending a while to get this to work (for me accepted answer didn't work, for me it's just half solution) i did following:

  1. Sadly, you must have visual studio (i installed express edition 2013 for DESKTOP)

  2. Installed python 2.7.3 (you don't have to set any environment variables)

  3. Run cmd as administrator and go to you project root (where is you package.json file)

  4. First run: npm config set python C:\Python27\python.exe

  5. Then: npm install -msvs_version=2013

The trick is in command npm config set python ...path_to_python_exe... which will be provided by npm to dependency which needs python i guess. I don't know why setting python as env variable is not enough.

Solution 4:

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