Keep getting below error when I run npm install --verbose to install my Node.js application, which is indirectly using node-gyp to compile re2 module. I've followed guidelines here
$ /cygdrive/c/Python27/python.exe --version
Python 2.7.16
node -v
v11.9.0
npm -v
6.9.0
Microsoft Windows 10 Enterpriseuname -a
CYGWIN_NT-10.0 TNJ10038LKVTJKF 3.0.7(0.338/5/3) 2019-04-30 18:08 x86_64 Cygwin
Desktop development with C++" workloadre2 moduleVerbose output from
npm install --verbose command:
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Users\\<myId>\\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'install',
npm verb cli '--verbose' ]
npm info using [email protected]
npm info using [email protected]
npm verb npm-session 7378279f82bfc9e2
npm info lifecycle @data-leakage-protection/[email protected]~preinstall: @data-leakage-protection/[email protected]
npm timing stage:loadCurrentTree Completed in 6279ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 40ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 974ms
npm http fetch GET 200 https://registry.npmjs.org/@data-leakage-protection%2fsignatures 1287ms
npm http fetch GET 200 https://registry.npmjs.org/fs-extra 341ms
npm http fetch GET 200 https://registry.npmjs.org/re2 822ms
npm http fetch GET 200 https://registry.npmjs.org/fsevents 354ms
npm http fetch GET 200 https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz 950ms
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 7464ms
npm timing stage:loadIdealTree Completed in 9344ms
npm timing stage:generateActionsToTake Completed in 282ms
npm verb correctMkdir C:\Users\<myId>\\AppData\Roaming\npm-cache\_locks correctMkdir not in flight; initializing
npm verb lock using C:\Users\<myId>\\AppData\Roaming\npm-cache\_locks\staging-4c24b48be61e8043.lock for C:\git\ecom\git-repo-inspector\node_modules\.staging
npm http fetch GET 200 https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz 332ms
npm http fetch GET 200 https://registry.npmjs.org/re2/-/re2-1.8.4.tgz 651ms
npm http fetch GET 200 https://registry.npmjs.org/@data-leakage-protection/signatures/-/signatures-1.1.1.tgz 934ms
npm timing action:extract Completed in 1512ms
npm info lifecycle undefined~preuninstall: undefined
npm info lifecycle undefined~uninstall: undefined
npm info lifecycle undefined~preuninstall: undefined
npm info lifecycle undefined~uninstall: undefined
npm info lifecycle undefined~preuninstall: undefined
npm info lifecycle undefined~uninstall: undefined
npm info lifecycle undefined~preuninstall: undefined
npm info lifecycle undefined~uninstall: undefined
npm timing action:unbuild Completed in 7ms
npm timing action:remove Completed in 1ms
npm timing action:finalize Completed in 428ms
npm timing audit submit Completed in 2097ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 2098ms
npm timing audit body Completed in 5ms
npm timing action:refresh-package-json Completed in 418ms
npm info lifecycle [email protected]~preinstall: [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm info lifecycle @data-leakage-protection/[email protected]~preinstall: @data-leakage-protection/[email protected]
npm timing action:preinstall Completed in 1ms
npm info linkStuff [email protected]
npm info linkStuff [email protected]
npm info linkStuff @data-leakage-protection/[email protected]
npm timing action:build Completed in 3ms
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle [email protected]~install: [email protected]
> [email protected] install C:\git\ecom\git-repo-inspector\node_modules\@data-leakage-protection\signatures\node_modules\re2
> node-gyp rebuild
C:\git\ecom\git-repo-inspector\node_modules\@data-leakage-protection\signatures\node_modules\re2>if not defined npm_config_node_gyp (node "C:\Users\<myId>\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "c:\Users\<myId>\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli 'c:\\Users\\<myId>\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli 'rebuild' ]
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "c:\Python27\python.exe" in the PATH
gyp verb `which` succeeded c:\Python27\python.exe c:\Python27\python.exe
gyp verb check python version `c:\Python27\python.exe -c "import sys; print "2.7.16
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 11.9.0
gyp verb command install [ '11.9.0' ]
gyp verb install input version string "11.9.0"
gyp verb install installing version: 11.9.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 11.9.0
gyp verb build dir attempting to create "build" dir: C:\git\ecom\git-repo-inspector\node_modules\@data-leakage-protection\signatures\node_modules\re2\build
gyp verb build dir "build" dir needed to be created? C:\git\ecom\git-repo-inspector\node_modules\@data-leakage-protection\signatures\node_modules\re2\build
gyp verb find vs2017 Found installation at: C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional
gyp verb find vs2017 - Found Microsoft.VisualStudio.Component.Windows10SDK.17134
gyp verb find vs2017 - Found Microsoft.VisualStudio.Component.VC.Tools.x86.x64
gyp verb find vs2017 - Found Microsoft.VisualStudio.VC.MSBuild.Base
gyp verb find vs2017 - Using this installation with Windows 10 SDK
gyp verb find vs2017 using installation: C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: C:\git\ecom\git-repo-inspector\node_modules\@data-leakage-protection\signatures\node_modules\re2\build\config.gypi
gyp verb config.gypi checking for gypi file: C:\git\ecom\git-repo-inspector\node_modules\@data-leakage-protection\signatures\node_modules\re2\config.gypi
gyp verb common.gypi checking for gypi file: C:\git\ecom\git-repo-inspector\node_modules\@data-leakage-protection\signatures\node_modules\re2\common.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn c:\Python27\python.exe
gyp info spawn args [ 'c:\\Users\\<myId>\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-G',
gyp info spawn args 'msvs_version=2015',
gyp info spawn args '-I',
gyp info spawn args 'C:\\git\\ecom\\git-repo-inspector\\node_modules\\@data-leakage-protection\\signatures\\node_modules\\re2\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'c:\\Users\\<myId>\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\<myId>\\.node-gyp\\11.9.0\\include\\node\\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\\Users\\<myId>\\.node-gyp\\11.9.0',
gyp info spawn args '-Dnode_gyp_dir=c:\\Users\\<myId>\\AppData\\Roaming\\npm\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\Users\\<myId>\\.node-gyp\\11.9.0\\<(target_arch)\\node.lib',
gyp info spawn args '-Dmodule_root_dir=C:\\git\\ecom\\git-repo-inspector\\node_modules\\@data-leakage-protection\\signatures\\node_modules\\re2',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'C:\\git\\ecom\\git-repo-inspector\\node_modules\\@data-leakage-protection\\signatures\\node_modules\\re2\\build',
gyp info spawn args '-Goutput_dir=.' ]
Traceback (most recent call last):
File "c:\Users\<myId>\AppData\Roaming\npm\node_modules\node-gyp\gyp\gyp_main.py", line 13, in <module>
import gyp
ImportError: No module named gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (c:\Users\v094303\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:345:16)
gyp ERR! stack at ChildProcess.emit (events.js:197:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "c:\\Users\\v094303\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\git\ecom\git-repo-inspector\node_modules\@data-leakage-protection\signatures\node_modules\re2
gyp ERR! node -v v11.9.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm verb lifecycle [email protected]~install: unsafe-perm in lifecycle true
npm verb lifecycle [email protected]~install: PATH: C:\Users\v094303\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\git\ecom\git-repo-inspector\node_modules\@data-leakage-protection\signatures\node_modules\re2\node_modules\.bin;C:\git\ecom\git-repo-inspector\node_modules\@data-leakage-protection\signatures\node_modules\.bin;C:\git\ecom\git-repo-inspector\node_modules\.bin;C:\cygwin64\usr\local\bin;C:\cygwin64\bin;C:\Program Files (x86)\Python36-32\Scripts;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\MySQL\MySQL Utilities 1.3.5;C:\Program Files (x86)\GitExtensions;C:\Program Files\PuTTY;C:\Program Files (x86)\Sennheiser\SoftphoneSDK;C:\Program Files\Redis;C:\Program Files\Git\cmd;C:\program files\Java\jre8\bin;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio;C:\Program Files\nodejs;C:\cygwin64\bin;C:\Users\v094303\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\MySQL\MySQL Utilities 1.3.5;C:\Program Files (x86)\GitExtensions;C:\Program Files\PuTTY;C:\Program Files (x86)\Sennheiser\SoftphoneSDK;C:\Program Files\Redis;C:\program files\Java\jre8\bin;C:\Users\v094303\AppData\Local\Microsoft\WindowsApps;C:\Maven\apache-maven-3.5.2\bin;C:\ProgramData\Visual Studio Code;C:\Users\v094303\AppData\Roaming\npm
npm verb lifecycle [email protected]~install: CWD: C:\git\ecom\git-repo-inspector\node_modules\@data-leakage-protection\signatures\node_modules\re2
npm info lifecycle [email protected]~install: Failed to exec install script
npm timing action:install Completed in 5548ms
npm verb unlock done using C:\Users\v094303\AppData\Roaming\npm-cache\_locks\staging-4c24b48be61e8043.lock for C:\git\ecom\git-repo-inspector\node_modules\.staging
npm timing stage:rollbackFailedOptional Completed in 578ms
npm timing stage:runTopLevelLifecycles Completed in 25352ms
npm WARN enoent ENOENT: no such file or directory, open 'C:\git\ecom\git-repo-inspector\node_modules\fsevents\package.json'
npm verb enoent This is related to npm not being able to find a file.
npm verb enoent
npm WARN enoent ENOENT: no such file or directory, open 'C:\git\ecom\git-repo-inspector\node_modules\fsevents\node_modules\rc\package.json'
npm verb enoent This is related to npm not being able to find a file.
npm verb enoent
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\jest-haste-map\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
npm verb stack Error: [email protected] install: `node-gyp rebuild`
npm verb stack Exit status 1
npm verb stack at EventEmitter.<anonymous> (C:\Users\v094303\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
npm verb stack at EventEmitter.emit (events.js:197:13)
npm verb stack at ChildProcess.<anonymous> (C:\Users\v094303\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
npm verb stack at ChildProcess.emit (events.js:197:13)
npm verb stack at maybeClose (internal/child_process.js:978:16)
npm verb stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
npm verb pkgid [email protected]
npm verb cwd C:\git\ecom\git-repo-inspector
npm verb Windows_NT 10.0.16299
npm verb argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\v094303\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "--verbose"
npm verb node v11.9.0
npm verb npm v6.9.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 1, true ]
npm timing npm Completed in 27439ms
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\v094303\AppData\Roaming\npm-cache\_logs\2019-06-18T12_03_59_895Z-debug.log
My npm config list settings:
npm config list
; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.9.0 node/v11.9.0 win32 x64"
; project config C:\git\ecom\git-repo-inspector\.npmrc
package-lock = false
unsafe-perm = true
; userconfig C:\Users\v094303\.npmrc
https-proxy = "http://<redacted>.<redacted>.com:80/"
msvs_version = "2017"
node_gyp = "c:\\Users\\<myId>\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js"
noproxy = ".<redacted>.com"
prefix = "C:\\Users\\<myId>\\\AppData\\Roaming\\npm"
proxy = "http://<redacted>.<redacted>.com:80/"
python = "c:\\Python27\\python.exe"
; builtin config undefined
prefix = "C:\\Users\\<myId>\\\AppData\\Roaming\\npm"
; node bin location = C:\Program Files\nodejs\node.exe
; cwd = C:\git\ecom\git-repo-inspector
; HOME = C:\Users\<myId>\
; "npm config ls -l" to show all defaults.
Update: I was able to successfully complete the build. For all those interested this document/repo details how I was able to fix things.
@rvagg I was hoping someone can comment on some of the findings, for example this one. Could it be something that needs a code fix, or might it be particular to my environment? Thanks.
K, I'll leave this open for a bit longer in case one of our windows experts has the bandwidth to have a look and has some idea, be warned that there's limited bandwidth available around here and it's not uncommon for more obscure issues to go unanswered. Mostly this issue tracker is a cross-your-fingers kind of deal.
From the linked code fix I would guess under Cygwin sys.argv[0] does not include the full path to the script. Maybe using abspath:
sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), 'pylib'))
will fix this?
@joquijada I don't have Cygwin, could you test this? This also would be a nice first PR :)
@bzoz Certainly, will try it out and will reply, EOW at the latest. Thanks a lot.
@bzoz Tried the change, but the absolute path it's building points to re2 module inside my package folder, which is invalid path to be able to find node-gyp's pylib/ folder, see CUSTOM: The path that will be used to load 'gyp' module is /cygdrive/c/git/ecom/git-repo-inspector/node_modules/re2/pylib below. The CUSTOM: The other path is pylib... message points out the path that my fix constructs and with which I got things to install successfully when my fix is enabled, which essentially is the relative pylib/ path to whatever folder things are executing in. In my case I'm pointing to node-gyp installation in my user folder, C:\Users\<my user ID>\AppData\Roaming\npm\node_modules\node-gyp\, as per the npm config below:
node_gyp = "/Users/<my user ID>/AppData/Roaming/npm/node_modules/node-gyp/bin/node-gyp.js"
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'C:\\git\\ecom\\git-repo-inspector\\node_modules\\re2\\build',
gyp info spawn args '-Goutput_dir=.' ]
****************************
*** CUSTOM FIXES DISABLED ***
****************************
CUSTOM: The path that will be used to load 'gyp' module is /cygdrive/c/git/ecom/git-repo-inspector/node_modules/re2/pylib
CUSTOM: The other path is pylib
Traceback (most recent call last):
File "C:\Users\<my user ID>\AppData\Roaming\npm\node_modules\node-gyp\gyp\gyp_main.py", line 38, in <module>
import gyp
ImportError: No module named gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\<my user ID>\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:344:16)
gyp ERR! stack at ChildProcess.emit (events.js:197:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\<my user ID>\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\git\ecom\git-repo-inspector\node_modules\re2
gyp ERR! node -v v11.9.0
gyp ERR! node-gyp -v v5.0.0
gyp ERR! not ok
npm verb lifecycle [email protected]~install: unsafe-perm in lifecycle true
Should we just try using the relative path (pylib/), or might that introduce problems in other kinds of setups?
Thanks.
Ok, so I've found this on StackOverflow: https://stackoverflow.com/questions/3718657/how-to-properly-determine-current-script-directory. Looks like the correct way to get the script path is:
os.path.dirname(os.path.abspath(__file__))
So, can you try this:
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'pylib'))
@joquijada did you try those changes?
@bzoz Not yet, will try by Friday, thanks.
@bzoz I did further research as well, and found this: https://trac.sagemath.org/ticket/25811. It looks like the os.path.abspath is being given a Windows-style path, and consequently returns something like:
/cygdrive/c/git/ecom/git-repo-inspector/node_modules/re2/C:\Users\v094303\AppData\Roaming\npm\node_modules\node-gyp\gyp\gyp_main.py
Perhaps we need to give Python a "little help" dealing with Windows paths properly in a Cygwin environment. I was thinking of using command cygpath -u <some windows path>, example:
cygpath -u "C:\Users\v094303\AppData\Roaming\npm\node_modules\node-gyp\gyp\gyp_main.py"
and outputs
/cygdrive/c/Users/v094303/AppData/Roaming/npm/node_modules/node-gyp/gyp/gyp_main.py
The Angular CLI ng app for instance makes use of the cygpath command to assist with path format conversion for Cygwin users:
/cygdrive/c/Users/v094303/AppData/Roaming/npm/ng:
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/node_modules/@angular/cli/bin/ng" "$@"
ret=$?
else
node "$basedir/node_modules/@angular/cli/bin/ng" "$@"
ret=$?
fi
exit $ret
I can try out my solution and create a PR. Below is more debug statements I added in the log to help me analyze.
CUSTOM: The path that will be used to load 'gyp' module is /cygdrive/c/Users/v094303/AppData/Roaming/npm/node_modules/node-gyp/gyp/pylib
CUSTOM: sys.argv[0] is C:\Users\v094303\AppData\Roaming\npm\node_modules\node-gyp\gyp\gyp_main.py
CUSTOM: __file__ is C:\Users\v094303\AppData\Roaming\npm\node_modules\node-gyp\gyp\gyp_main.py
CUSTOM: sys.path[0] is /cygdrive/c/Users/v094303/AppData/Roaming/npm/node_modules/node-gyp/gyp/pylib
CUSTOM: os.path.abspath(__file__) is /cygdrive/c/git/ecom/git-repo-inspector/node_modules/re2/C:\Users\v094303\AppData\Roaming\npm\node_modules\node-gyp\gyp\gyp_main.py
CUSTOM: os.path.dirname(os.path.abspath(__file__)) is /cygdrive/c/git/ecom/git-repo-inspector/node_modules/re2
CUSTOM: os.path.dirname(sys.path[0]) is /cygdrive/c/Users/v094303/AppData/Roaming/npm/node_modules/node-gyp/gyp
CUSTOM: os.path.join(sys.path[0], 'pylib') is /cygdrive/c/Users/v094303/AppData/Roaming/npm/node_modules/node-gyp/gyp/pylib/pylib
I really don't have any idea how Cygwin works. But if you make a PR, we can run it through CI, I can give it a spin locally, and hopefully, we can get this issue solved.