Can't install any native extensions

I decided to give ionic a try today, and I’m running into issues when installing native extensions.

I’m still new to ionic/javascript, so I will outline the steps I’m taking:

npm install -g cordova ionic ionic start TestProject blank cd TestProject ionic cordova plugin add cordova-plugin-android-permissions
When prompted that The plugin @ionic/cli-plugin-cordova is not installed. Would you like to install it and continue? (Y/n) I say Y.

Then the error finally happens when I try to install the npm module for the cordova plugin:

npm install --save @ionic-native/android-permissions

I get a UNMET PEER DEPENDENCY error:

+-- @ionic-native/android-permissions@3.14.0 -- UNMET PEER DEPENDENCY @ionic/app-scripts@2.0.0

It seems that the native plugins aren’t compatible with app-scripts version 2+. This happens with any of the other native cordova plugins I try to install, for example the BLE plugin as well.

I’ve tried to install an older version of the app-scripts (i.e., 1.x), but then when npm installs it, I get a red INVALID next to the app-scripts name after installation.

Does anyone know what I should do?

I had a similar problem.

Since i migrated from -v1 to -v2 i got many errors. When i tried to migrate to -v3 everything broke.

What fixed everything to me was to create a new project with -v3 and putted all my pages in again was alot of work but worth it. I can now install everything again.

I hope this will fix your problem (if you migrated ofc).

This seems like a regression of the recent app-scripts update to 2.x. I think this is a bug and reported it at https://github.com/ionic-team/ionic-native/issues/1783 using your output.

Does it actually break anything or does the project work anyway?

Post your ionic info output please so we know more about your environment.

Got a response on the issue UNMET PEER DEPENDENCY @ionic/app-scripts@2.0.0 · Issue #1783 · danielsogl/awesome-cordova-plugins · GitHub

Ionic native modules do not depend on @ionic/app-scripts. That error is probably caused by another module. If there is an unmet dependency, the warning is displayed on every command.

Hmm…

I followed the commands you posted and actually can’t reproduce this at all. Could you please try again?

(But there actually seems to be a “problem”, see https://github.com/ionic-team/ionic-cli/issues/2505 - but not output directly with current npm versions.)