Node v10.14.2, NPM 6.5.0
Windows 10
Hi,
Whenever I called node-gyp, I got same error message.
陌ssue is module path is wrong. I check paths
Correct Path:
"C:\Users\Asus\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js"
Wrong Path:
"C:\Users\Asus\AppData\Roaming\npm\node_modules\npm\node_modules\node_modules\node-gyp\bin\node-gyp.js"
under node_modules directory there is no another node_modules directory and I check .cmd file it has same path structure with other modules, but system generate wrong path, so it cannot find the module. I see I am not alone, many people has same problem on Windows. Is the module tested on Windows? Because I am sure about I read the installation instructions carefully. I set all configuration variables and installed windows-build-tools successfully
I solved problem. I want to share maybe it can help others too.
Firstly, there are a few node-gyp.cmd files, so I have to find correct cmd file
CMD Filepath:
"%userprofile%\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin"
and open notepad as administrator and change content as
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\..\..\..\..\node-gyp\bin\node-gyp.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\..\..\..\..\node_modules\node-gyp\bin\node-gyp.js" %*
)
It is work for me, I hope it helps you too.
I solved problem. I want to share maybe it can help others too.
Firstly, there are a few node-gyp.cmd files, so I have to find correct cmd file
CMD Filepath:
"%userprofile%\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin"
and open notepad as administrator and change content as@IF EXIST "%~dp0\node.exe" ( "%~dp0\node.exe" "%~dp0\..\..\..\..\..\node-gyp\bin\node-gyp.js" %* ) ELSE ( @SETLOCAL @SET PATHEXT=%PATHEXT:;.JS;=;% node "%~dp0\..\..\..\..\..\node_modules\node-gyp\bin\node-gyp.js" %* )It is work for me, I hope it helps you too.
It is work for me, thanks man! @Catutigernos
I solved problem. I want to share maybe it can help others too.
Firstly, there are a few node-gyp.cmd files, so I have to find correct cmd file
CMD Filepath:
"%userprofile%\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin"
and open notepad as administrator and change content as@IF EXIST "%~dp0\node.exe" ( "%~dp0\node.exe" "%~dp0\..\..\..\..\..\node-gyp\bin\node-gyp.js" %* ) ELSE ( @SETLOCAL @SET PATHEXT=%PATHEXT:;.JS;=;% node "%~dp0\..\..\..\..\..\node_modules\node-gyp\bin\node-gyp.js" %* )It is work for me, I hope it helps you too.
Didn't helped, and I simply removed this dir node-gyp-bin under:
C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle - worked just fine.
Also got it right by removing the node-gyp-bin folder under C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle. Thanks @TemaSM
For some reason, deleting that folder fixed this error for me as well. But I can't understand why? Any ideas?
@Catutigernos @TemaSM @shirilele @psyklopz for whatever reason when calling node-gyp you end up running npm internal node-gyp script. I know it has been some time, but maybe the issue still reproduces on your machines? If so:
1) can you run where node-gyp and paste the results here?
2) can you share your PATH environment variable? Pasting the result of running echo %PATH% would be great.
3) do you remember maybe your "Node history"? Which version you installed, if you upgraded it, maybe the packages that you installed? There is definitely something off in your setups, knowing your upgrade path would be helpful to find the offending package.
Thanks!
C:\Users\Eric>where node-gyp
C:\Users\Eric\AppData\Roaming\npm\node-gyp
C:\Users\Eric\AppData\Roaming\npm\node-gyp.cmd

I don't recall my node history, this is a fairly new laptop, and the issue occurred almost immediately. There may have been npm install -g node-gyp and npm remove -g node-gyp. I was using v10 when the problem first started.
@psyklopz Thanks!
seems like this might be resolved, also see https://github.com/felixrieseberg/windows-build-tools/pull/188
Most helpful comment
Didn't helped, and I simply removed this dir
node-gyp-binunder:C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle- worked just fine.