Operating System: Windows 10 Pro
Version: 10.0.15063 Build 15063
Command Prompt: ConEmu
Startup Tasks:
set PATH=%ConEmuBaseDir%\Scripts;%PATH%
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat"
"C:\Program Files\nodejs\nodevars.bat"
After installing, and re-installing (npm i gatsby-cli@latest -g
), I still can't execute gatsby
commands outside of the Node.js command prompt
on my box.
What did I do wrong?
Same OS and symptom here. I can run gatsby from the node.js prompt but not the cmd prompt or PowerShell for example.
Same issue here.
Can you use any other npm global packages? Can you check if after using echo %PATH%
in command prompt you see there path to npm? (should be something like C:\Users\<username>\AppData\Roaming\npm
The path to npm is there in both command windows if I run as standard user. But gatsby and seemingly most other node applications are blocked by group policy unless I run the prompt as admin. As admin, the path to npm shows up in the node prompt (pointing to my usersadmin-account... folder), but not in the Windows command prompt.
I'm not sure if this something gatsby can fix? This seem more of npm
issue here especially that this problem exists in other node applications :/
I just tried with Vue and I got the same behavior.
Editing my admin account's path variable to include the npm path solved the problem.
Note that I clicked to edit system variables in step 2 so that I would be prompted for my admin creds. If the OP doesn't have to use an admin account, then he can click Edit environment variables for your account instead.
For me the issue is resolved. And thanks @pieh for that tip about the npm path, which has resolved my other similar node issues as well! Perhaps @consultwithmike could comment on whether this solution works for him. If so, it is an npm/node issue and not in Gatsby's purview IMO as well.
I'll close this as this issue is not really gatsby related.
This issue is not Gatsby related.
Most helpful comment
I just tried with Vue and I got the same behavior.
Editing my admin account's path variable to include the npm path solved the problem.
Note that I clicked to edit system variables in step 2 so that I would be prompted for my admin creds. If the OP doesn't have to use an admin account, then he can click Edit environment variables for your account instead.
For me the issue is resolved. And thanks @pieh for that tip about the npm path, which has resolved my other similar node issues as well! Perhaps @consultwithmike could comment on whether this solution works for him. If so, it is an npm/node issue and not in Gatsby's purview IMO as well.