Npm ERR! could not determine executable to run

I solved the problem. The solution was that @capacitor/cli is a dev dependency and in this new image, npm wasn’t installing dev dependencies, thus npx cap was not installed and was not working.