GeezerVison is showing github.com — [Known Issue] `npm i -g nativescript` error: gyp: binding.gyp not found · Issue #10509 · NativeScript/NativeScript
[Known Issue] npm i -g nativescript error: gyp: binding.gyp not found #10509DescriptionIssue Description
npm install --global nativescript
npm WARN deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm ERR! code 1
npm ERR! path /opt/homebrew/lib/node_modules/nativescript/node_modules/fsevents
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | arm64
npm ERR! gyp info find Python using Python version 3.12.2 found at "/opt/homebrew/opt/[email protected]/bin/python3.12"
npm ERR! gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.12
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/opt/homebrew/lib/node_modules/nativescript/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/opt/homebrew/lib/node_modules/nativescript/node_modules/fsevents/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/opt/homebrew/lib/node_modules/nativescript/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/danny/Library/Caches/node-gyp/21.7.2/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/Users/danny/Library/Caches/node-gyp/21.7.2',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/opt/homebrew/lib/node_modules/nativescript/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/danny/Library/Caches/node-gyp/21.7.2/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/opt/homebrew/lib/node_modules/nativescript/node_modules/fsevents',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp: binding.gyp not found (cwd: /opt/homebrew/lib/node_modules/nativescript/node_modules/fsevents) while trying to load binding.gyp
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (/opt/homebrew/lib/node_modules/nativescript/node_modules/node-gyp/lib/configure.js:297:18)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:519:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Darwin 23.4.0
npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node/21.7.2/bin/node" "/opt/homebrew/lib/node_modules/nativescript/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /opt/homebrew/lib/node_modules/nativescript/node_modules/fsevents
npm ERR! gyp ERR! node -v v21.7.2
npm ERR! gyp ERR! node-gyp -v v10.1.0
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in: /Users/danny/.npm/_logs/2024-04-09T05_55_44_073Z-debug-0.log
Reproduction
npm install --global nativescript
Relevant log output (if applicable)
No response
Environment
No response
Please accept these terms
Reacted by Christian Rishøj and Jason Activityrigor789 commented on Apr 9, 2024 This is an issue introduced in NPM 10.4.0 - I have reported it here: npm/cli#7355
As a workaround:
npm i -g npm@~10.3
npm i -g nativescript Reacted by Danny Su, GOVINDA ALWANI, Sébastien JEAN, iliiliili, Renan Degrandi, Aza Noriega, Centulus, Mitchell, Roman Drahan, German Rosario and 2 more Reacted by Bagaskara Wisnu Gunawan changed the title [-]gyp: binding.gyp not found[/-] [+][Known Issue] `npm i -g nativescript` error: gyp: binding.gyp not found[/+] on Apr 9, 2024NathanWalker commented on May 6, 2024 Another issue you may see similar to this can look like this:
npm ERR! code 1
npm ERR! path /Users/me/Documents/project/node_modules/better-sqlite3
npm ERR! command failed
npm ERR! command sh -c prebuild-install || node-gyp rebuild --release
npm ERR! prebuild-install warn install No prebuilt binaries found (target=20.11.0 runtime=node arch=arm64 libc= platform=darwin)
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | arm64
npm ERR! gyp info find Python using Python version 3.12.3 found at "/opt/homebrew/opt/[email protected]/bin/python3.12"
npm ERR! gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.12
... more omitted for brevity ...
npm ERR! Traceback (most recent call last):
npm ERR! File "/Users/me/Documents/project/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
npm ERR! import gyp # noqa: E402
npm ERR! ^^^^^^^^^^
npm ERR! File "/Users/me/Documents/project/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
npm ERR! import gyp.input
npm ERR! File "/Users/me/Documents/project/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
npm ERR! from distutils.version import StrictVersion
npm ERR! ModuleNotFoundError: No module named 'distutils'
You can set this in your ~/.zshrc to resolve:
export npm_config_python=/opt/homebrew/bin/python3.11
Just be sure to open new terminal tab, or source ~/.zshrc after adding. Reacted by Rolle Laukkarinen jono-hayward commented on May 26, 2024
This is an issue introduced in NPM 10.4.0 - I have reported it here: npm/cli#7355
As a workaround:
npm i -g npm@~10.3
npm i -g nativescript
Could this workaround maybe be added to the setup documentation? Would have saved me a couple of days of googling and reinstalling things 😂 Reacted by Bagaskara Wisnu Gunawan NathanWalker commented on May 28, 2024 @jono-hayward it appears fixed on cli next with npm 10.8.
For example, this is what we see when installing next - if you get a chance to confirm from your end would be great.
% npm -v
10.8.0
% npm i -g nativescript@next
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported. Please use @npmcli/package-json instead.
npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
removed 1 package, and changed 849 packages in 25s
76 packages are looking for funding
run `npm fund` for details
% ns -v
8.7.1-next-05-20-2024-9165247539
You can npm i -g npm and then just npm i -g nativescript@next - if that's clear for you we'll include in a patch. rigor789 commented on May 28, 2024
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|