-
Notifications
You must be signed in to change notification settings - Fork 635
Description
When trying to build Edge on my machine, the follow errors result when running the recommended bat files for building (no matter if I try to use the buildall.bat, build_double.bat or build.bat , results are the same) :
Building edge.node release for node.js x64 v5.1.0
Cannot find node-gyp at C:\Users\myusername\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js. Make sure to instal l with npm install node-gyp -g
The issue is that the BAT scripts are using (found on line 51 of build.bat, and line 89 of build_double.bat )
set GYP=%APPDATA%\npm\node_modules\node-gyp\bin\node-gyp.js
The script should be deriving the path of a installed node-gyp by asking NODE where its modules are installed, not by assuming it will be located in the specific hard coded %APPDATA% .
For example, rebuilding tools generally resort to the equivalent of the javascript (such as in electron-rebuild and the like) :
require.resolve('npm/node_modules/node-gyp/bin/node-gyp')
to get the properly resolved module location. (although that resolves to local copies, if installed, and you may want to get the globally installed only)...
As it is, users with node version control of any kind, will get the kind of failure reported above.