Node-gyp: Unable to install on Windows 10

Created on 14 Oct 2015  路  7Comments  路  Source: nodejs/node-gyp

I have 64bit Windows 10, Visual Studio 2015. I'm trying to a module that uses node-gyp (kerberos) and I'm seeing this output in the console:

gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\Dan\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "node" "C:\Users\Dan\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Dan\AppData\Roaming\npm\node_modules\kerberos
gyp ERR! node -v v0.12.6
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok

I've tried using Node 4.0.2 and NPM 3.3.6, but I've also tried reverting to Node 0.12.6 and NPM 2.14.5 and still see the same error. I've installed a bunch of Windows SDKs and updates to SDKs. I've tried installing with --msvs_version=2013 and --msvs_version=2015 flags. Nothing is working. I have Python 2.7.10 and referenced in my PATH.

Windows

Most helpful comment

I failed many times that make me feel sick and depressed:( just now I change python 3 to 2.7 lastest and add PYTHON environment and add python to sysytem path, and just run cmd as admin input npm install -g node-gyp everything is allright!
Before above,What I'v done is below:
1.Install Visual Studio Community 2015 Edition. (Custom Install, Select Visual C++ during the installation) and add the environment variable GYP_MSVS_VERSION, value is 2015.
2.Run the command prompt as Administrator
3.run npm install --msvs_version=2015
4.Make sure your python is allllll-right!!!(as for me I use python 3 and never successQvQ)
5.`npm install -g node-gyp' as I said in the beginning.

I need to use this for building angular material start project and I just success:-)
I hope I don't forget some important thing233

All 7 comments

Am I doing something wrong? I've been through the installation guide for windows and installed all the pre-reqs..? I've spent hours going through other issues, installing things, uninstalling things, adding things to my PATH...Is there just a comprehensive list of what you need to do to get this working? I've been through the installation guide already but it seems a little out of date

I am able to install node-gyp on my Windows 7 Pro machine at work without any errors. On this system I have:

node --version // 0.12.7
npm --v // 2.11.3

With the following MS updates/service packs/apps installed:

ms_items

Somewhere in here is the key, will compare and contrast with what I have on my Win 10 machine

Also having problems on windows 10, strangely enough I can install a specific version

npm install -g [email protected]

npm install -g node-gyp though produces an error

npm-debug.log below the fold


0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli '-g',
1 verbose cli 'install',
1 verbose cli 'node-gyp' ]
2 info using [email protected]
3 info using [email protected]
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData node-gyp
8 silly fetchOtherPackageData node-gyp
9 silly cache add args [ 'node-gyp', null ]
10 verbose cache add spec node-gyp
11 silly cache add parsed spec Result {
11 silly cache add raw: 'node-gyp',
11 silly cache add scope: null,
11 silly cache add name: null,
11 silly cache add rawSpec: 'node-gyp',
11 silly cache add spec: 'C:\Program Files\nodejs\node-gyp',
11 silly cache add type: 'local' }
12 silly addLocalTarball shasum (computed) 3949f0f5b7fffd4e4b783f19b44b1cf2fda2ee7d
13 verbose addTmpTarball C:\Program Files\nodejs\node-gyp not in flight; adding
14 verbose addTmpTarball validating metadata from C:\Program Files\nodejs\node-gyp
15 verbose tar unpack C:\Program Files\nodejs\node-gyp
16 verbose tar unpacking to C:\Users\Mopholo\AppData\Local\Temp\npm-14356-5112a228\unpack-3f760d2c860a1b637634c2785195f25b
17 silly gentlyRm C:\Users\Mopholo\AppData\Local\Temp\npm-14356-5112a228\unpack-3f760d2c860a1b637634c2785195f25b is being purged
18 verbose gentlyRm don't care about contents; nuking C:\Users\Mopholo\AppData\Local\Temp\npm-14356-5112a228\unpack-3f760d2c860a1b637634c2785195f25b
19 silly gunzTarPerm modes [ '777', '666' ]
20 error not a package C:\Program Files\nodejs\node-gyp
21 error addLocal Could not install C:\Program Files\nodejs\node-gyp
22 silly fetchPackageMetaData Error: ENOENT: no such file or directory, open 'C:\Users\Mopholo\AppData\Local\Temp\npm-14356-5112a228\unpack-3f760d2c860a1b637634c2785195f25b\package.json'
22 silly fetchPackageMetaData at Error (native)
22 silly fetchPackageMetaData error for node-gyp { [Error: ENOENT: no such file or directory, open 'C:\Users\Mopholo\AppData\Local\Temp\npm-14356-5112a228\unpack-3f760d2c860a1b637634c2785195f25b\package.json']
22 silly fetchPackageMetaData errno: -4058,
22 silly fetchPackageMetaData code: 'ENOENT',
22 silly fetchPackageMetaData syscall: 'open',
22 silly fetchPackageMetaData path: 'C:\Users\Mopholo\AppData\Local\Temp\npm-14356-5112a228\unpack-3f760d2c860a1b637634c2785195f25b\package.json' }
23 silly rollbackFailedOptional Starting
24 silly rollbackFailedOptional Finishing
25 silly runTopLevelLifecycles Starting
26 silly runTopLevelLifecycles Finishing
27 silly install printInstalled
28 verbose stack Error: ENOENT: no such file or directory, open 'C:\Users\Mopholo\AppData\Local\Temp\npm-14356-5112a228\unpack-3f760d2c860a1b637634c2785195f25b\package.json'
28 verbose stack at Error (native)
29 verbose cwd C:\Program Files\nodejs
30 error Windows_NT 10.0.10240
31 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "-g" "install" "node-gyp"
32 error node v4.2.1
33 error npm v3.3.9
34 error path C:\Users\Mopholo\AppData\Local\Temp\npm-14356-5112a228\unpack-3f760d2c860a1b637634c2785195f25b\package.json
35 error code ENOENT
36 error errno -4058
37 error syscall open
38 error enoent ENOENT: no such file or directory, open 'C:\Users\Mopholo\AppData\Local\Temp\npm-14356-5112a228\unpack-3f760d2c860a1b637634c2785195f25b\package.json'
38 error enoent This is most likely not a problem with npm itself
38 error enoent and is related to npm not being able to find a file.
39 verbose exit [ -4058, true ]

I had the same problems.

I believe the problem is caused by VS2015.

As I do not need it and had to explicitly install it for node-gyp, I tried uninstalling it and installing VS2013 instead. That solved the problem for me.

@danwellman: I see that your work computer uses VS2010 so this might be why it works there

I have solved the problem by adding both npm config -g set msvs_version=2015 and changing some bits in \Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSVersion.py file. More specifically I have added VS2015 related data to versions, version_to_year and version_map collections

finnally I can install seccessfully on Windows 10 pro:)

I failed many times that make me feel sick and depressed:( just now I change python 3 to 2.7 lastest and add PYTHON environment and add python to sysytem path, and just run cmd as admin input npm install -g node-gyp everything is allright!
Before above,What I'v done is below:
1.Install Visual Studio Community 2015 Edition. (Custom Install, Select Visual C++ during the installation) and add the environment variable GYP_MSVS_VERSION, value is 2015.
2.Run the command prompt as Administrator
3.run npm install --msvs_version=2015
4.Make sure your python is allllll-right!!!(as for me I use python 3 and never successQvQ)
5.`npm install -g node-gyp' as I said in the beginning.

I need to use this for building angular material start project and I just success:-)
I hope I don't forget some important thing233

Was this page helpful?
0 / 5 - 0 ratings

Related issues

halkar picture halkar  路  4Comments

jlchereau picture jlchereau  路  3Comments

Yamakaky picture Yamakaky  路  3Comments

Sentero-esp12 picture Sentero-esp12  路  3Comments

good-idea picture good-idea  路  3Comments