Ionic package build error: Cannot find module 'graceful-fs'


I’m having some problems with ionic package build. Trying to do ionic package build android, or ios gives me the error: Error: Cannot find module ‘graceful-fs’. It doesn’t log anything else, just that.

Does anyone know how to fix this?

you are trying to import something that doesn’t exist, check your imports

Please post the whole error message you are getting.
What is the exact command you are running?
What is your ionic info output?

Have you tried building locally?

That was actually the whole error message that package build gave me. Thank you for your suggestion of building locally, that gave me a better error message and I was able to troubleshoot my problem. I didn’t think to do that since ionic serve was working fine.

Can you share what the solution was?

Local ionic build was giving errors about @angular/animations, I updated it in package.json and it works now.

However I have a new problem, now I’m getting an error in the cloud dashboard. All android builds are failing and the output in the dashboard says:

ANDROID_HOME=/opt/android-sdk JAVA_HOME=/usr/lib/jvm/java-8-oracle Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK. Looked here: /opt/android-sdk/tools/templates/gradle/wrapper

Create a new topic for that problem please.

(Also inlcude your ionic info and cordova requirements output please in that new topic)