node-gyp build error windows x64

前端 未结 10 1476
情书的邮戳
情书的邮戳 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:29

    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.

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

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

    --msvs_version=2012
    

    so for example

    npm install --msvs_version=2012 <package>
    
    0 讨论(0)
  • 2020-11-28 22:35

    For me the solution that worked with VS express was to simply install Visual Studio 2013 Express for desktop (which is the only one that gives you a developer command prompt as of 2013 version). Open developer command prompt (elevated) and run NPM install commands. This did not require any special --msvs_version arguments, it just worked.

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

    For me (Windows 7 64bit),

    I struggled with this issue for half of a day Finally It worked.

    On my way :

    1. At control panel, I deleted all Python, Microsoft Visual Studio, Microsoft Redistributable, and something about I installed to solve this.

    2. Window Update and restart.

    3. Installed Python27, and Visual Studio 2013 with no setting env-val

    4. npm install node-gyp -g

    5. I got an error same thing, but after npm config set msvs_version 2013 --global , It works.
    0 讨论(0)
提交回复
热议问题