Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs on npm Install #245

Open
xuyeliu opened this issue Jan 26, 2025 · 8 comments
Open

Bugs on npm Install #245

xuyeliu opened this issue Jan 26, 2025 · 8 comments

Comments

@xuyeliu
Copy link

xuyeliu commented Jan 26, 2025

When trying "npm install", I got this error. I tried many ways to debug, but cannot find the reason. Any hints on that? Thanks
npm error code 1
npm error path /Users/xyl/Desktop/Waterloo/DocumentingCode/void/node_modules/@vscode/sqlite3
npm error command failed
npm error command sh -c node-gyp rebuild
npm error gyp info it worked if it ends with ok
npm error gyp info using [email protected]
npm error gyp info using [email protected] | darwin | arm64
npm error gyp info find Python using Python version 3.13.1 found at "/opt/homebrew/opt/[email protected]/bin/python3.13"
npm error gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.13
npm error gyp info spawn args [
npm error gyp info spawn args '/Users/xyl/.nvm/versions/node/v18.20.6/lib/node_modules/npm/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 '/Users/xyl/Desktop/Waterloo/DocumentingCode/void/node_modules/@vscode/sqlite3/build/config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/Users/xyl/.nvm/versions/node/v18.20.6/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/Users/xyl/Library/Caches/node-gyp/30.5.1/include/node/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=/Users/xyl/Library/Caches/node-gyp/30.5.1',
npm error gyp info spawn args '-Dnode_gyp_dir=/Users/xyl/.nvm/versions/node/v18.20.6/lib/node_modules/npm/node_modules/node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=/Users/xyl/Library/Caches/node-gyp/30.5.1/<(target_arch)/node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=/Users/xyl/Desktop/Waterloo/DocumentingCode/void/node_modules/@vscode/sqlite3',
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 No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
npm error
npm error No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
npm error
npm error No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
npm error
npm error Traceback (most recent call last):
npm error File "/Users/xyl/.nvm/versions/node/v18.20.6/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1496, in XcodeVersion
npm error version_list = GetStdoutQuiet(["xcodebuild", "-version"]).splitlines()
npm error ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm error File "/Users/xyl/.nvm/versions/node/v18.20.6/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1557, in GetStdoutQuiet
npm error raise GypError("Error %d running %s" % (job.returncode, cmdlist[0]))
npm error gyp.common.GypError: Error 1 running xcodebuild
npm error
npm error During handling of the above exception, another exception occurred:
npm error
npm error Traceback (most recent call last):
npm error File "/Users/xyl/.nvm/versions/node/v18.20.6/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 45, in
npm error sys.exit(gyp.script_main())
npm error ~~~~~~~~~~~~~~~^^
npm error File "/Users/xyl/.nvm/versions/node/v18.20.6/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 688, in script_main
npm error return main(sys.argv[1:])
npm error File "/Users/xyl/.nvm/versions/node/v18.20.6/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 680, in main
npm error return gyp_main(args)
npm error File "/Users/xyl/.nvm/versions/node/v18.20.6/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 665, in gyp_main
npm error generator.GenerateOutput(flat_list, targets, data, params)
npm error ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm error File "/Users/xyl/.nvm/versions/node/v18.20.6/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2648, in GenerateOutput
npm error writer.Write(
npm error ~~~~~~~~~~~~^
npm error qualified_target,
npm error ^^^^^^^^^^^^^^^^^
npm error ...<4 lines>...
npm error part_of_all=qualified_target in needed_targets,
npm error ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm error )
npm error ^
npm error File "/Users/xyl/.nvm/versions/node/v18.20.6/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 880, in Write
npm error self.WriteActions(
npm error ~~~~~~~~~~~~~~~~~^
npm error spec["actions"],
npm error ^^^^^^^^^^^^^^^^
npm error ...<3 lines>...
npm error part_of_all,
npm error ^^^^^^^^^^^^
npm error )
npm error ^
npm error File "/Users/xyl/.nvm/versions/node/v18.20.6/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1014, in WriteActions
npm error env = self.GetSortedXcodeEnv()
npm error File "/Users/xyl/.nvm/versions/node/v18.20.6/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2266, in GetSortedXcodeEnv
npm error return gyp.xcode_emulation.GetSortedXcodeEnv(
npm error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
npm error self.xcode_settings,
npm error ^^^^^^^^^^^^^^^^^^^^
npm error ...<3 lines>...
npm error additional_settings,
npm error ^^^^^^^^^^^^^^^^^^^^
npm error )
npm error ^
npm error File "/Users/xyl/.nvm/versions/node/v18.20.6/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1882, in GetSortedXcodeEnv
npm error env = _GetXcodeEnv(
npm error xcode_settings, built_products_dir, srcroot, configuration, additional_settings
npm error )
npm error File "/Users/xyl/.nvm/versions/node/v18.20.6/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1737, in _GetXcodeEnv
npm error "XCODE_VERSION_ACTUAL": XcodeVersion()[0],
npm error ~~~~~~~~~~~~^^
npm error File "/Users/xyl/.nvm/versions/node/v18.20.6/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1507, in XcodeVersion
npm error version = CLTVersion() # macOS Catalina returns 11.0.0.0.1.1567737322
npm error File "/Users/xyl/.nvm/versions/node/v18.20.6/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1545, in CLTVersion
npm error return re.search(regex, output).groupdict()["version"]
npm error ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm error AttributeError: 'NoneType' object has no attribute 'groupdict'
npm error gyp ERR! configure error
npm error gyp ERR! stack Error: gyp failed with exit code: 1
npm error gyp ERR! stack at ChildProcess. (/Users/xyl/.nvm/versions/node/v18.20.6/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:297:18)
npm error gyp ERR! stack at ChildProcess.emit (node:events:517:28)
npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:292:12)
npm error gyp ERR! System Darwin 23.6.0
npm error gyp ERR! command "/Users/xyl/.nvm/versions/node/v18.20.6/bin/node" "/Users/xyl/.nvm/versions/node/v18.20.6/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm error gyp ERR! cwd /Users/xyl/Desktop/Waterloo/DocumentingCode/void/node_modules/@vscode/sqlite3
npm error gyp ERR! node -v v18.20.6
npm error gyp ERR! node-gyp -v v10.1.0
npm error gyp ERR! not ok
npm error A complete log of this run can be found in: /Users/xyl/.npm/_logs/2025-01-26T21_01_22_304Z-debug-0.log

@andrewpareles
Copy link
Contributor

Any chance it works if you change to Node version 20.16.0?

@andrewpareles andrewpareles moved this to 👀 Improvements (B) in 🚙 Void Roadmap Jan 26, 2025
@DoctorGlitchy
Copy link

@xuyeliu Are you using a Mac by any chance?

@xuyeliu
Copy link
Author

xuyeliu commented Jan 27, 2025

@xuyeliu Are you using a Mac by any chance?

Yes, I'm using Mac

@xuyeliu
Copy link
Author

xuyeliu commented Jan 27, 2025

Node version 20.16.0?

Tried it. get similar error

@ernivani
Copy link

are you using v18.20.6 of node ? with nvm ?
@xuyeliu

currently using

node -v
v22.10.0

and no issue with the npm install

@jcommaret
Copy link
Contributor

jcommaret commented Jan 27, 2025

We can see that your node version is 18.20.6

nodes_modules requires the version to be set at 20.16.0

In some cases, this is working with a slightly newer version but this won't work with a older version than 20.16.0

-> You changed the node_version but the node_modules have some cache.

Check before doing any npm install that you have the good node version : 20.16.0

To fix you installation, delete and totally erase void folder then :

  1. Check your node version.
  2. Change your node version to the good one, using your node version manager.
  3. Make sure you have the good python version installed otherwise node-gyp will annoy you and destroy your all your esperance
  4. Then git clone, cd and npm install.

This will work.

@xuyeliu
Copy link
Author

xuyeliu commented Jan 27, 2025

I followed your steps. And I tried python 10 and python 12. But still get the same error...

Image

We can see that your node version is 18.20.6

nodes_modules requires the version to be set at 20.16.0

In some cases, this is working with a slightly newer version but this won't work with a older version than 20.16.0

-> You changed the node_version but the node_modules have some cache.

Check before doing any npm install that you have the good node version : 20.16.0

To fix you installation, delete and totally erase void folder then :

  1. Check your node version.
  2. Change your node version to the good one, using your node version manager.
  3. Make sure you have the good python version installed otherwise node-gyp will annoy you and destroy your all your esperance
  4. Then git clone, cd and npm install.

This will work.

@andrewpareles
Copy link
Contributor

Happy to do a quick call to fix these issues. [email protected] or just shoot me a discord DM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 Improvements (B)
Development

No branches or pull requests

5 participants