Closed codeconsole closed 2 years ago
Using Node installed with nodenv
works, but I don't understand why the brew
installation doesn't.
capactitor seems to be the only cli that has issues using the brew
installed version.
% brew uninstall node
% brew install nodenv
% echo 'export PATH=${PATH}:~/.nodenv/shims' >> ~/.zprofile
% nodenv install 17.7.2
% nodenv global 17.7.2
% npx cap run android
β Copying web assets from www to android/app/src/main/assets/public in 7.48ms
β Creating capacitor.config.json in android/app/src/main/assets in 745.25ΞΌs
β copy android in 12.87ms
β Updating Android plugins in 3.42ms
[info] Found 3 Capacitor plugins for android:
@capacitor/camera@1.3.1
@capacitor/filesystem@1.1.0
@capacitor/geolocation@1.3.1
β update android in 32.04ms
β Running Gradle build in 1.32s
β Deploying app-debug.apk to emulator-5554 in 1.88s
Using Node installed with
nodenv
works, but I don't understand why thebrew
installation doesn't. capactitor seems to be the only cli that has issues using thebrew
installed version.% brew uninstall node % brew install nodenv % echo 'export PATH=${PATH}:~/.nodenv/shims' >> ~/.zprofile % nodenv install 17.7.2 % nodenv global 17.7.2 % npx cap run android β Copying web assets from www to android/app/src/main/assets/public in 7.48ms β Creating capacitor.config.json in android/app/src/main/assets in 745.25ΞΌs β copy android in 12.87ms β Updating Android plugins in 3.42ms [info] Found 3 Capacitor plugins for android: @capacitor/camera@1.3.1 @capacitor/filesystem@1.1.0 @capacitor/geolocation@1.3.1 β update android in 32.04ms β Running Gradle build in 1.32s β Deploying app-debug.apk to emulator-5554 in 1.88s
Because brew
does not install expect
utility? And script can't spawn
process
Because
brew
does not installexpect
utility? And script can'tspawn
process
@random-rage no, that's not it. I can confirm expect exists and works and switching back to the brew
installation does not work.
% nodenv uninstall 17.7.2
% nodenv uninstall 16.14.2
% brew install node
% npx cap run android
β Copying web assets from www to android/app/src/main/assets/public in 6.59ms
β Creating capacitor.config.json in android/app/src/main/assets in 757.79ΞΌs
β copy android in 11.18ms
β Updating Android plugins in 1.37ms
[info] Found 3 Capacitor plugins for android:
@capacitor/camera@1.3.1
@capacitor/filesystem@1.1.0
@capacitor/geolocation@1.3.1
β update android in 22.13ms
β Running Gradle build - failed!
[error] ERR_SUBPROCESS_COMMAND_NOT_FOUND
% which expect
/usr/bin/expect
% expect
expect1.1>
I have the same issue and I have noted it here and I can confirm that I was using node from brew from a long time now without a problem and only just recently, something happened and I'm getting ERR_SUBPROCESS_COMMAND_NOT_FOUND
when trying to run on android.
@butaminas I have been using brew node for on a long time with my other MacBook. I only started having this issue when I tried a MacBook with an M1 chip. Are you using the same computer/os as the one that was previosuly working?
@codeconsole yes and it's an intel mac, therefore, I doubt that it's M1 related.
The suggestion to delete node
and install it via nodenv
did fix the problem for me. However, I had to do a couple more steps to manually delete node like so as brew uninstall node
was not enough:
brew uninstall node;
which node;
sudo rm -rf /usr/local/bin/node;
sudo rm -rf /usr/local/lib/node_modules/npm/;
brew doctor;
brew cleanup --prune-prefix;
Anyway, it was working with the regular brew node
on an intel mac with the latest MacOS so I'm really confused about what exactly happened that made it stop working.
My only idea for now is that I did brew update
and it updated node
and this somehow corrupted the node
installation on the system.
So this happened to me on my Intel mac using brews node@16
both after brew updates weirdly for other packages... I think maybe ffmpeg, you can get better output if you call without npx
it like this ionic capacitor run android --verbose
That says capacitor:android:run Invoking ./gradlew with args: [ 'assembleDebug' ]
is what's failing but calling gradlew manually works.
I can confirm that switching to nodenv works I went with node LTS though 16.14.2, below where my steps. I'd love to know what the real issue here was.
brew uninstall node@16
brew install nodenv
echo 'export PATH=${PATH}:~/.nodenv/shims' >> ~/.zshrc
nodenv install 16.14.2
nodenv global 16.14.2
node --version
ionic capacitor run android
I hope this helps someone. I had this issue 2 times now. I think its because my brew updated my node version to v17. When I ran node -v
it returned v17...
. I forgot exactly what eversion but it was 17. When I run ionic cap run android -l --external
I eventually get the following error:
β Running Gradle build - failed!
[error] ERR_SUBPROCESS_COMMAND_NOT_FOUND
Here is what I did:
1) I installed nvm
2) I ran nvm use stable
3) When I run node -v
it returns v14.17.6
Now when I run ionic cap run android -l --external
it works perfectly
@joeyk16 not sure why you want to run such an old version, my solution works fine with 17.7.2 v14.17.6 is wicked old.
There seems to be some weird bug on the nodejs installed from homebrew (not only 17, I've seen it on 16 and 14 too, 12 worked fine)
I've created a gist with a simplification of the code that is failing, and it's nodejs spawn behaving differently on the homebrew node installs when running the gradle file, it calls the error function with ENOENT and the close function with -2 code, but the gradle execution finished correctly with
BUILD SUCCESSFUL in 490ms 1 actionable task: 1 executed
When using node from nvm/nodenv it doesn't call the error function and the close is called with code 0
As noted in https://github.com/Homebrew/homebrew-core/issues/99688, this is a bug in libuv
. Will be fixed in https://github.com/Homebrew/homebrew-core/pull/99801.
Should be fixed by a
brew update && brew upgrade libuv
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.
Bug Report ERR_SUBPROCESS_COMMAND_NOT_FOUND
What command is it looking for? Perhaps the error should specify?
Capacitor Version
Platform(s)
@capacitor/android: 3.4.3
Current Behavior
Expected Behavior
Expect the app to run in the emulator
Code Reproduction
https://github.com/codeconsole/exiftest/tree/capacitor
Other Technical Details
npm --version
output:8.5.5
node --version
output:v17.8.0
pod --version
output (iOS issues only):1.11.2
Additional Context