Open ZedThree opened 1 week ago
it works for me apart from OS ( i am using mac ) all the parameters and config is same
Now using node v22.3.0 (npm v10.8.1)
~/workarea/rep $ npm install --save-dev git://github.com/stadelmanma/tree-sitter-fortran.git
added 5 packages, and audited 6 packages in 55s
found 0 vulnerabilities
~/workarea/rep $
So presumably something in my environment causing this? Any ideas on how I could further debug this?
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Running
npm update
fails when callingnode-gyp build
because some of the arguments are duplicated. The package is:"tree-sitter-fortran": "git://github.com/stadelmanma/tree-sitter-fortran.git"
, and I can see in the error message:and, later, the error:
Notice that in the first snippet we essentially end up with
gyp_main.py binding.gyp gyp_main.py binding.gyp ...
. This tries to usegyp_main.py
as a build file, which I guess is causing theSyntaxError
in the second snippet.Full output:
``` $ npm update npm error code 7 npm error git dep preparation failed npm error command /usr/bin/node22 /usr/lib64/node_modules/npm22/bin/npm-cli.js install --force --cache=/home/peter/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run npm error > tree-sitter-fortran@0.2.0 install npm error > node-gyp-build npm error npm warn using --force Recommended protections disabled. npm error gyp info it worked if it ends with ok npm error gyp info using node-gyp@10.1.0 npm error gyp info using node@22.3.0 | linux | x64 npm error gyp info find Python using Python version 3.11.10 found at "/usr/bin/python3" npm error gyp info spawn /usr/bin/python3 npm error gyp info spawn args [ npm error gyp info spawn args '/usr/lib64/node_modules/npm22/node_modules/node-gyp/gyp/gyp_main.py', npm error gyp info spawn args 'binding.gyp', npm error gyp info spawn args '-f', npm error gyp info spawn args 'make', npm error gyp info spawn args '-I', npm error gyp info spawn args '/home/peter/.npm/_cacache/tmp/git-cloneXXXXXX7MIWmy/build/config.gypi', npm error gyp info spawn args '-I', npm error gyp info spawn args '/home/peter/.npm/_cacache/tmp/git-cloneXXXXXX7MIWmy/build/config.gypi', npm error gyp info spawn args '-I', npm error gyp info spawn args '/home/peter/.npm/_cacache/tmp/git-cloneXXXXXX7MIWmy/build/config.gypi', npm error gyp info spawn args '-I', npm error gyp info spawn args '/home/peter/.npm/_cacache/tmp/git-cloneXXXXXX7MIWmy/build/config.gypi', npm error gyp info spawn args '-I', npm error gyp info spawn args '/usr/lib64/node_modules/npm22/node_modules/node-gyp/addon-rpm.gypi', npm error gyp info spawn args '-I', npm error gyp info spawn args '/usr/include/node22/common.gypi', npm error gyp info spawn args '-Dlibrary=shared_library', npm error gyp info spawn args '-Dvisibility=default', npm error gyp info spawn args '-Dnode_root_dir=/usr/include/node22', npm error gyp info spawn args '-Dnode_gyp_dir=/usr/lib64/node_modules/npm22/node_modules/node-gyp', npm error gyp info spawn args '-Dnode_lib_file=/usr/include/node22/<(target_arch)/node.lib', npm error gyp info spawn args '-Dmodule_root_dir=/home/peter/.npm/_cacache/tmp/git-cloneXXXXXX7MIWmy', npm error gyp info spawn args '-Dnode_engine=v8', npm error gyp info spawn args '--depth=.', npm error gyp info spawn args '--no-parallel', npm error gyp info spawn args '--generator-output', npm error gyp info spawn args 'build', npm error gyp info spawn args '-Goutput_dir=.' npm error gyp info spawn args ] npm error gyp info spawn /usr/bin/python3 npm error gyp info spawn args [ npm error gyp info spawn args '/usr/lib64/node_modules/npm22/node_modules/node-gyp/gyp/gyp_main.py', npm error gyp info spawn args 'binding.gyp', npm error gyp info spawn args '/usr/lib64/node_modules/npm22/node_modules/node-gyp/gyp/gyp_main.py', npm error gyp info spawn args 'binding.gyp', npm error gyp info spawn args '-f', npm error gyp info spawn args 'make', npm error gyp info spawn args '-I', npm error gyp info spawn args '/home/peter/.npm/_cacache/tmp/git-cloneXXXXXX7MIWmy/build/config.gypi', npm error gyp info spawn args '-I', npm error gyp info spawn args '/home/peter/.npm/_cacache/tmp/git-cloneXXXXXX7MIWmy/build/config.gypi', npm error gyp info spawn args '-I', npm error gyp info spawn args '/home/peter/.npm/_cacache/tmp/git-cloneXXXXXX7MIWmy/build/config.gypi', npm error gyp info spawn args '-I', npm error gyp info spawn args '/home/peter/.npm/_cacache/tmp/git-cloneXXXXXX7MIWmy/build/config.gypi', npm error gyp info spawn args '-I', npm error gyp info spawn args '/usr/lib64/node_modules/npm22/node_modules/node-gyp/addon-rpm.gypi', npm error gyp info spawn args '-I', npm error gyp info spawn args '/usr/include/node22/common.gypi', npm error gyp info spawn args '-Dlibrary=shared_library', npm error gyp info spawn args '-Dvisibility=default', npm error gyp info spawn args '-Dnode_root_dir=/usr/include/node22', npm error gyp info spawn args '-Dnode_gyp_dir=/usr/lib64/node_modules/npm22/node_modules/node-gyp', npm error gyp info spawn args '-Dnode_lib_file=/usr/include/node22/<(target_arch)/node.lib', npm error gyp info spawn args '-Dmodule_root_dir=/home/peter/.npm/_cacache/tmp/git-cloneXXXXXX7MIWmy', npm error gyp info spawn args '-Dnode_engine=v8', npm error gyp info spawn args '--depth=.', npm error gyp info spawn args '--no-parallel', npm error gyp info spawn args '--generator-output', npm error gyp info spawn args 'build', npm error gyp info spawn args '-Goutput_dir=.', npm error gyp info spawn args '-I', npm error gyp info spawn args '/usr/lib64/node_modules/npm22/node_modules/node-gyp/addon-rpm.gypi', npm error gyp info spawn args '-I', npm error gyp info spawn args '/usr/include/node22/common.gypi', npm error gyp info spawn args '-Dlibrary=shared_library', npm error gyp info spawn args '-Dvisibility=default', npm error gyp info spawn args '-Dnode_root_dir=/usr/include/node22', npm error gyp info spawn args '-Dnode_gyp_dir=/usr/lib64/node_modules/npm22/node_modules/node-gyp', npm error gyp info spawn args '-Dnode_lib_file=/usr/include/node22/<(target_arch)/node.lib', npm error gyp info spawn args '-Dmodule_root_dir=/home/peter/.npm/_cacache/tmp/git-cloneXXXXXX7MIWmy', npm error gyp info spawn args '-Dnode_engine=v8', npm error gyp info spawn args '--depth=.', npm error gyp info spawn args '--no-parallel', npm error gyp info spawn args '--generator-output', npm error gyp info spawn args 'build', npm error gyp info spawn args '-Goutput_dir=.' npm error gyp info spawn args ] npm error Traceback (most recent call last): npm error File "/usr/lib64/node_modules/npm22/node_modules/node-gyp/gyp/gyp_main.py", line 45, inIf I run
node-gyp build
manually in a local clone oftree-sitter-fortran
, it works fine.Expected Behavior
npm update
completes without error and builds the latest version of the dependencySteps To Reproduce
Run:
or alternatively:
Note that in this case, running
node-gyp build
directly does workEnvironment
legacy-peer-deps = true prefix = "/home/peter/.local"
; node bin location = /usr/bin/node22 ; node version = v22.3.0 ; npm local prefix = /tmp/test_npm ; npm version = 10.8.1 ; cwd = /tmp/test_npm ; HOME = /home/peter ; Run
npm config ls -l
to show all defaults.