Try the following:
Delete folder node_modules
Delete file package-lock.json
Run npm install again
If you get an error like this go to https://github.com/ionic-team/ionic/issues/11591 and do what is suggested there, installing gradle.
"Could not find an installed version of Gradle either in Android Studio, or on your system to install the gradle wrapper. Please include gradle in your path, or install Android Studio"