Ionic serve: [ERROR] ng has unexpectedly closed (exit code 127)

Hello, I’m getting the error you see in the title when running ionic serve.
The app is on github in a working state.
I tried to add the QRScanner Capacitor native plugin for Android, ios and Electron. So I installed all the packages

npm install @capacitor/core @capacitor/cli
npx cap init
npx cap add android
npx cap add ios
npx cap add electron

I had problems importing the plugin, it somehow wasn’t recognized as a provider… So when it wouldn’t serve:

[ERROR] ng has unexpectedly closed (exit code 127).

, I git reset --hard all the changes I made to the code after initial. So technically, this should be identical to what I have on Github right, but it still won’t run.
I’m just not sure if I did the above installs first, before pushing to Github, or after, but I certainly haven’t committed anything after trying to install the plugin.

I also installed Cordova because I thought I was gonna need it (honestly, the situation with Capacitor and Cordova is very confusing to me),but removing it again, hasn’t helped either.

(I looked at the other issues with this exact error on this forum , but they seem unresolved, or I overlooked the solution)


were you able to fix this? I am facing the same issue…

1 Like