Repository navigation
Cannot install on NodeJS 20 and npm 10.4.0 #5787
Description
Activity
- addedbug-pending-triageReported bug, pending triage to confirm.Reported bug, pending triage to confirm.
on Feb 5, 2024 Same bug here on node 20.10.0 :
npm ERR! code 1 npm ERR! path /usr/local/lib/node_modules/nativescript/node_modules/fsevents npm ERR! command failedOS: macOS 14.4 CPU: (12) arm64 Apple M3 Pro Shell: /bin/zsh node: 21.6.2 npm: 10.2.4 nativescript: 8.6.6-next-02-23-2024-8019050415 # ios xcode: 15.2/15C500b cocoapods: 1.15.2 python: Not Found python3: 3.9.6 ruby: 2.7.8 platforms: - DriverKit 23.2 - iOS 17.2 - macOS 14.2 - tvOS 17.2 - visionOS 1.0 - watchOS 10.2
No issues on node 21.6.2 here. I have seen others having issues with
fsevents(some on Windows) but not really sure what causes it - as far as I understandfseventswouldn't even attempt to build on Windows machines because it's macos specific. We also don't directly depend onfseventseither, plus it's marked optional so failing to build it shouldn't cause installation errors at all. I suspect it's either system env related, or annpmbug perhaps?npm why fsevents fsevents@2.3.3 optional node_modules/fsevents optional fsevents@"~2.3.2" from chokidar@3.5.3 node_modules/chokidar chokidar@"3.5.3" from the root project chokidar@"*" from @types/chokidar@2.1.3 node_modules/@types/chokidar dev @types/chokidar@"2.1.3" from the root project chokidar@"3.5.3" from mocha@10.2.0 node_modules/mocha dev mocha@"10.2.0" from the root project chokidar@"^3.5.2" from nodemon@2.0.22 node_modules/nodemon
I'm having the same problem of not being able to install on Ubuntu 22.04
Node: v20.11.1
npm: 10.5.0
Python: 3.12.2
NativeScript: 8.6.5Error:
npm i -g nativescript npm WARN deprecated phin@2.9.3: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau npm ERR! code 1 npm ERR! path /home/gerson/.asdf/installs/nodejs/20.11.1/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 node-gyp@10.0.1 npm ERR! gyp info using node@20.11.1 | linux | x64 npm ERR! gyp info find Python using Python version 3.12.2 found at "/home/gerson/.asdf/installs/python/3.12.2/bin/python" npm ERR! gyp info spawn /home/gerson/.asdf/installs/python/3.12.2/bin/python npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/home/gerson/.asdf/installs/nodejs/20.11.1/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 '/home/gerson/.asdf/installs/nodejs/20.11.1/lib/node_modules/nativescript/node_modules/fsevents/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/gerson/.asdf/installs/nodejs/20.11.1/lib/node_modules/nativescript/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/gerson/.cache/node-gyp/20.11.1/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=/home/gerson/.cache/node-gyp/20.11.1', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/home/gerson/.asdf/installs/nodejs/20.11.1/lib/node_modules/nativescript/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/home/gerson/.cache/node-gyp/20.11.1/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/gerson/.asdf/installs/nodejs/20.11.1/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: /home/gerson/.asdf/installs/nodejs/20.11.1/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:gypfailed with exit code: 1 npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (/home/gerson/.asdf/installs/nodejs/20.11.1/lib/node_modules/nativescript/node_modules/node-gyp/lib/configure.js:271:18) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:518:28) npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12) npm ERR! gyp ERR! System Linux 6.5.0-26-generic npm ERR! gyp ERR! command "/home/gerson/.asdf/installs/nodejs/20.11.1/bin/node" "/home/gerson/.asdf/installs/nodejs/20.11.1/lib/node_modules/nativescript/node_modules/.bin/node-gyp" "rebuild" npm ERR! gyp ERR! cwd /home/gerson/.asdf/installs/nodejs/20.11.1/lib/node_modules/nativescript/node_modules/fsevents npm ERR! gyp ERR! node -v v20.11.1 npm ERR! gyp ERR! node-gyp -v v10.0.1 npm ERR! gyp ERR! not okI have the same Problem on a MacBook Pro M2:
% node -v
v21.7.1% npm -v
10.5.0% npm i -g nativescript npm WARN deprecated phin@2.9.3: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau 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 node-gyp@10.0.1 npm ERR! gyp info using node@21.7.1 | darwin | arm64 npm ERR! gyp info find Python using Python version 3.12.2 found at "/opt/homebrew/opt/python@3.12/bin/python3.12" npm ERR! gyp info spawn /opt/homebrew/opt/python@3.12/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/amai/Library/Caches/node-gyp/21.7.1/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/amai/Library/Caches/node-gyp/21.7.1', 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/amai/Library/Caches/node-gyp/21.7.1/<(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:271: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.3.0 npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node/21.7.1/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.1 npm ERR! gyp ERR! node-gyp -v v10.0.1 npm ERR! gyp ERR! not okSee if this helps? nodejs/node-gyp#2992 (comment)
All of the errors above seem to have the Homebrew Python in common.
Maybe the system python would work better - you could also try uninstalling the brew python and try again.
We're likely going to simplify setup and not require python explicitly anymore soon (since it ships with xCode, we can likely use that one where python is needed in the runtime/metadata-generator)
I could not uninstall python from homebrew, because it is required by other packages like Podman.
Only using
NODE_GYP_FORCE_PYTHON=python3 npm i -g nativescriptproduced the same error.I do have the same problem, no matter what I have done (with brew installed python or native python from mac), It did not solve the problem. Strangely enough, the node-gyp is trying some thing which does not exists:
gyp: binding.gyp not found (cwd: /Users//.nvm/versions/node/v21.7.1/lib/node_modules/nativescript/node_modules/fsevents) while trying to load binding.gyp
the foldre /Users//.nvm/versions/node/v21.7.1/lib/node_modules/nativescript/ does not exist after the setup. I assume it was cached previously or it is being deleted right after the error occurs.Apple M3 Max with Sonomo 14.4.1
Seems like homebrew actually broke something with python. You can use
pip3 install setuptoolsand it should work again.it did not work, still getting the same error
I have created my env by using :
python3 -m venv ~/myenv
then I used:NODE_GYP_FORCE_PYTHON=/Users/<username>/myenv/bin/python npm i -g nativescript
Then I got the below:npm WARN deprecated phin@2.9.3: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau npm ERR! code 1 npm ERR! path /Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/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 node-gyp@10.1.0 npm ERR! gyp info using node@21.7.1 | darwin | arm64 npm ERR! gyp info find Python using Python version 3.12.2 found at "/Users/<username>/myenv/bin/python" npm ERR! gyp info spawn /Users/<username>/myenv/bin/python npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/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 '/Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/lib/node_modules/nativescript/node_modules/fsevents/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/lib/node_modules/nativescript/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/Users/<username>/Library/Caches/node-gyp/21.7.1/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/<username>/Library/Caches/node-gyp/21.7.1', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/lib/node_modules/nativescript/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/<username>/Library/Caches/node-gyp/21.7.1/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/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: /Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/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> (/Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/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 "/Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/bin/node" "/Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/lib/node_modules/nativescript/node_modules/.bin/node-gyp" "rebuild" npm ERR! gyp ERR! cwd /Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/lib/node_modules/nativescript/node_modules/fsevents npm ERR! gyp ERR! node -v v21.7.1 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/<username>/.npm/_logs/2024-03-29T01_21_07_719Z-debug-0.logsame applies when I use the system-wide python:
npm WARN deprecated phin@2.9.3: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau npm ERR! code 1 npm ERR! path /Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/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 node-gyp@10.1.0 npm ERR! gyp info using node@21.7.1 | darwin | arm64 npm ERR! gyp info find Python using Python version 3.9.6 found at "/Users/<username>/myenv/bin/python" npm ERR! gyp info spawn /Users/<username>/myenv/bin/python npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/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 '/Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/lib/node_modules/nativescript/node_modules/fsevents/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/lib/node_modules/nativescript/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/Users/<username>/Library/Caches/node-gyp/21.7.1/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/<username>/Library/Caches/node-gyp/21.7.1', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/lib/node_modules/nativescript/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/<username>/Library/Caches/node-gyp/21.7.1/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/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: /Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/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> (/Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/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 "/Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/bin/node" "/Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/lib/node_modules/nativescript/node_modules/.bin/node-gyp" "rebuild" npm ERR! gyp ERR! cwd /Users/<username>/Library/Application Support/fnm/node-versions/v21.7.1/installation/lib/node_modules/nativescript/node_modules/fsevents npm ERR! gyp ERR! node -v v21.7.1 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/<username>/.npm/_logs/2024-03-29T01_25_46_604Z-debug-0.logSeems like homebrew actually broke something with python. You can use
pip3 install setuptoolsand it should work again.FYI, I have completely removed brew installed python and used only system-wide provided python, it did not work ...
Downgrading npm to 10.3.0 worked for me ( after installing node 18.20)
Reacted by Alexander Mai, Pascal Martineau, Ryan Kurniawan and RobDowngrading to npm@10.3 while using node@21.7.1 worked for me.
Thank you @jcassidyavThe thing that worked for me was using yarn instead of npm.
yarn global add nativescript
Reacted by sarawut.sReacted by AGCReacted by AGCPlease see NativeScript/NativeScript#10509
Reacted by Eric CORBISIER- addedknown issueIssue that is known, has a fix or a workaround.Issue that is known, has a fix or a workaround.and removedbug-pending-triageReported bug, pending triage to confirm.Reported bug, pending triage to confirm.
on Apr 9, 2024 - pinned this issue
on Apr 9, 2024 Hello,
downgrading npm to version 10.3 worked for me:
npm i -g npm@~10.3
Thank you rigor789 👍Hello, downgrading
npmto version10.3also worked for me (with nodev20.11.0). Thanks for the help.- Reacted by Adrian Niculescu
The issue is indeed fixed.
Tested on node 20.14.0 with npm 10.8.0.npm install -g nativescriptworks as expected.
Thank you!Reacted by Igor Randjelovic
Issue Description
I am trying to update to NodeJS 20
on macOS Sonoma 14.3 I have a NodeJS installation managed with nvm
results in
Note that the same works on npm
10.2.4(which comes out-of-the-box with NodeJS 20.11.0) and also works on npm10.3.0, so it's something isolated to (or starting from) npm version10.3.4Reproduction
No response
Relevant log output (if applicable)
Environment
Dependencies
Please accept these terms