Peerinvalid errors after updating ionic

Hello!

Recently I’ve updated my ionic configuration to ionic@latest and got ‘peerinvalid’ errors for angular package. Please tell me how to satisfy the required dependencies:

$ ionic cordova platform add android
> cordova platform add android --save
✖ Running command - failed!
[ERROR] Exception: Using cordova-fetch for cordova-android@^6.3.0

        Error: Failed to fetch platform cordova-android@^6.3.0
        Probably this is either a connection problem, or platform spec is incorrect.
        Check your connection and platform name/version/URL.
        Error: npm: Command failed with exit code 1 Error output:
        npm ERR! Linux 3.16.0-4-amd64
        npm ERR! argv "/home/artem/.nvm/versions/node/v6.11.4/bin/node" 
        "/home/artem/disk2/Projects/AcroLink/Client/Mobile/node_modules/.bin/npm" "install" "cordova-android@^6.3.0" 
        "--production" "--save-exact"
        npm ERR! node v6.11.4
        npm ERR! npm  v2.15.12
        npm ERR! code EPEERINVALID
        
        npm ERR! peerinvalid The package @angular/common@4.4.6 does not satisfy its siblings' peerDependencies 
        requirements!
        npm ERR! peerinvalid Peer @angular/forms@4.4.6 wants @angular/common@4.4.6
        npm ERR! peerinvalid Peer @angular/platform-browser@4.4.6 wants @angular/common@4.4.6
        npm ERR! peerinvalid Peer @angular/platform-browser-dynamic@4.4.6 wants @angular/common@4.4.6
        npm ERR! peerinvalid Peer ionic-angular@3.0.1 wants @angular/common@4.0.0
        
        npm ERR! Please include the following file with any support request:
        npm ERR!     /home/artem/disk2/Projects/AcroLink/Client/Mobile/npm-debug.log
$ ionic info

cli packages: (/home/artem/disk2/Projects/AcroLink/Client/Mobile/node_modules)

    @ionic/cli-utils  : 1.13.1
    ionic (Ionic CLI) : 3.13.2

global packages:

    cordova (Cordova CLI) : 7.1.0 

local packages:

    @ionic/app-scripts : 3.0.0
    Cordova Platforms  : none
    Ionic Framework    : ionic-angular 3.0.1

System:

    Android SDK Tools : 26.1.1
    Node              : v6.11.4
    npm               : 2.15.12 
    OS                : Linux 3.16

Misc:

    backend : legacy

npm-debug.log

2579 info install cordova-android@6.3.0
2580 info postinstall cordova-android@6.3.0
2581 verbose unlock done using /home/artem/.npm/_locks/cordova-android-662ced93f6303832.lock for /home/artem/disk2/Projects/AcroLink/Client/Mobile/node_modules/cordova-android
2582 verbose validateInstall loading /home/artem/disk2/Projects/AcroLink/Client/Mobile/package.json for validation
2583 verbose stack Error: The package @angular/common@4.4.6 does not satisfy its siblings' peerDependencies requirements!
2583 verbose stack     at /home/artem/disk2/Projects/AcroLink/Client/Mobile/node_modules/npm/lib/install.js:125:32
2583 verbose stack     at /home/artem/disk2/Projects/AcroLink/Client/Mobile/node_modules/npm/lib/install.js:268:7
2583 verbose stack     at /home/artem/disk2/Projects/AcroLink/Client/Mobile/node_modules/npm/node_modules/read-installed/read-installed.js:142:5
2583 verbose stack     at /home/artem/disk2/Projects/AcroLink/Client/Mobile/node_modules/npm/node_modules/read-installed/read-installed.js:263:14
2583 verbose stack     at cb (/home/artem/disk2/Projects/AcroLink/Client/Mobile/node_modules/npm/node_modules/slide/lib/async-map.js:47:24)
2583 verbose stack     at /home/artem/disk2/Projects/AcroLink/Client/Mobile/node_modules/npm/node_modules/read-installed/read-installed.js:263:14
2583 verbose stack     at cb (/home/artem/disk2/Projects/AcroLink/Client/Mobile/node_modules/npm/node_modules/slide/lib/async-map.js:47:24)
2583 verbose stack     at /home/artem/disk2/Projects/AcroLink/Client/Mobile/node_modules/npm/node_modules/read-installed/read-installed.js:263:14
2583 verbose stack     at cb (/home/artem/disk2/Projects/AcroLink/Client/Mobile/node_modules/npm/node_modules/slide/lib/async-map.js:47:24)
2583 verbose stack     at /home/artem/disk2/Projects/AcroLink/Client/Mobile/node_modules/npm/node_modules/read-installed/read-installed.js:263:14
2584 verbose cwd /home/artem/disk2/Projects/AcroLink/Client/Mobile
2585 error Linux 3.16.0-4-amd64
2586 error argv "/home/artem/.nvm/versions/node/v6.11.4/bin/node" "/home/artem/disk2/Projects/AcroLink/Client/Mobile/node_modules/.bin/npm" "install" "cordova-android@^6.3.0" "--production" "--save-exact"
2587 error node v6.11.4
2588 error npm  v2.15.12
2589 error code EPEERINVALID
2590 error peerinvalid The package @angular/common@4.4.6 does not satisfy its siblings' peerDependencies requirements!
2590 error peerinvalid Peer @angular/forms@4.4.6 wants @angular/common@4.4.6
2590 error peerinvalid Peer @angular/platform-browser@4.4.6 wants @angular/common@4.4.6
2590 error peerinvalid Peer @angular/platform-browser-dynamic@4.4.6 wants @angular/common@4.4.6
2590 error peerinvalid Peer ionic-angular@3.0.1 wants @angular/common@4.0.0
2591 verbose exit [ 1, true ]
1 Like

I had the same problem when trying to install cordova-plugin-camera :weary:
The solution was to tape

cordova plugin add cordova-plugin-camera

instead of

ionic cordova plugin add cordova-plugin-camera

2 Likes

By the way, you can check your oudated plugin via:

npm outdated

or try also

npm update

Hope it helps a little :slight_smile:

1 Like

I’ve fixed this problem.

Behra, try to view your dependencies with ‘npm outdated’ command. Then edit manually ‘package.json’ for correct package versions. Then run

npm update
npm install

1 Like

Thanks, we had the same solution :wink: