Node Version:
NODE: v6.11.1
NPM: 5.3.0
Platform:
Window 10E x64 1703
Compiler:
VS2015
Module:
Sorry if this is a noob question, but I can't seem to figure this out.
I installed node-gyp fine from C:node-gyp, but it's not being added to my PATH.
Where is the executable to add to my PATH?
C:\WINDOWS\system32>cd C:\node-gyp
C:\node-gyp>npm install -g node-gyp
C:\Users\Administrator\AppData\Roaming\npm\node-gyp -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js
+ [email protected]
updated 1 package in 4.723s
C:\node-gyp>
You don't usually have to install node-gyp yourself. It's bundled with npm and npm takes care of executing it when installing modules that need it.
Plus a general windows tip, you can run where node-gyp or where npm in a cmd.exe console, and cmd will tell you where the files it can run are. For example:
T:\sw\ddl> where npm
C:\bin\dev\node\npm
C:\bin\dev\node\npm.cmd
@bnoordhuis & @refack - appreciate the responses.
I do understand both of your points, and that SHOULD work, but it's not in my environment for some reason despite a successful install as you see in my OP. Which is why I was asking how to manually add it to my PATH because I can't seem to invoke node-gyp:
Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>where npm
C:\Program Files\nodejs\npm
C:\Program Files\nodejs\npm.cmd
C:\WINDOWS\system32>where node
C:\Program Files\nodejs\node.exe
C:\WINDOWS\system32>where node-gyp
INFO: Could not find files for the given pattern(s).
C:\WINDOWS\system32>node -v
v6.11.1
C:\WINDOWS\system32>npm -v
5.3.0
C:\WINDOWS\system32>node-gyp list
'node-gyp' is not recognized as an internal or external command,
operable program or batch file.
C:\WINDOWS\system32>
If you installed node-gyp with npm install -g, then it's wherever npm puts global binaries. See https://stackoverflow.com/questions/33819757/global-npm-install-location-on-windows for more info.
@bnoordhuis -
Right, I've got that DIR, and I can navigate to it, but again, how do I launch node-gyp from that DIR? ...or any Directory?
Where is the actual .exe or .bat file?
Thx
There should be a node-gyp.cmd in that directory, unless you have bin-links set to false in your npm config.
I don't want to cut this conversation short but your questions are really about npm, not node-gyp. Happy to help if you can't figure something out but see if you can find the answer in npm's documentation first.
@bnoordhuis -
with all due respect, I run many many NPM and Node packages without issue. I simply followed your exact instructions, and I can't run your specific package. That's all. I'm trying to understand what I'm doing wrong here.
I DO NOT have a node-gyp.cmd in that DIR.

@seanvree node-gyp (and any other global npm packages) uses an npm mechanism to create the "shim" that is used to run the the CLI endpoint of the package (in this case node-gyp.cmd).
npm puts it in the directory pointed to by npm config get prefix
You can run these two commands and check that the npm global directory is in your %Path%
this will show you npm's configuration
> npm config list
this will pretty print the directories in your %Path%
> for %G in ("%Path:;=" "%") do @echo %G
Ref: docs about binary shims https://docs.npmjs.com/files/package.json#bin
P.S. if you have [email protected] installed you can also run node-gyp with the following npx -g node-gyp (npx is sort of a super-shim that can run any package that has a CLI entry point)
[added]
P.P.S. looking at your original comment it seems npm put the shim in C:\Users\Administrator\AppData\Roaming\npm\node-gyp.cmd check that it's there, and that C:\Users\Administrator\AppData\Roaming\npm\ is in your %Path%
BTW: This is a node installer issue
I DO NOT have a node-gyp.cmd in that DIR.
That's because you are in the node-gyp directory, not in npm's global bin directory.
@seanvree I'm closing this issue because it is not node-gyp specific. AFAICT you will not be able to get any global module to install it's shim in your path.
Feel free to reopen if you think that's wrong, or if you have new information.
As I mentioned before this is a known node installer issue - https://github.com/nodejs/node/issues/12345
@bnoordhuis - that was it! When you said above "There should be a node-gyp.cmd in that directory," I thought you meant in the node-gyp DIR.
simple miscommunication.
Thanks
Most helpful comment
Plus a general windows tip, you can run
where node-gyporwhere npmin acmd.execonsole, and cmd will tell you where the files it can run are. For example: