Error: The version of @ionic-native/[email protected] is not compatible with its sibling packages' peerDependencies

When attempting

ionic cordova build android --prod
, the following error occurred:

I have tried this multiple times.

 rm -rf node_modules/ 
 rm -rf platforms/ 
 rm -rf plugins/

I deleted package.lock.json and ran npm i, but no luck so far. Any ideas?

Error

$ ionic cordova build android --prod

cordova.cmd platform add android --save Using cordova-fetch for [email protected] Failed to fetch platform [email protected] Probably this is either a connection problem, or platform spec is incorrect. Check your connection and platform name/version/URL. Error: cmd: Command failed with exit code 1 Error output: npm ERR! Windows_NT 10.0.17763 npm ERR! argv "C:\Program Files\nodejs\node.exe" "D:\Clients\ionic4\node_modules\npm\bin\npm-cli.js" "install" "[email protected]" "--production" "--save-exact" npm ERR! node v12.4.0 npm ERR! npm v2.15.12 npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package @ionic-native/[email protected] does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer @ionic-native/[email protected] wants @ionic-native/core@^5.1.0 npm ERR! peerinvalid Peer @ionic-native/[email protected] wants @ionic-native/core@^5.1.0 npm ERR! peerinvalid Peer @ionic-native/[email protected] wants @ionic-native/core@^5.1.0 npm ERR! peerinvalid Peer @ionic-native/[email protected] wants @ionic-native/core@^5.1.0 npm ERR! peerinvalid Peer @ionic-native/[email protected] wants @ionic-native/core@^5.1.0 npm ERR! peerinvalid Peer @ionic-native/[email protected] wants @ionic-native/core@^5.1.0 npm ERR! peerinvalid Peer @ionic-native/[email protected] wants @ionic-native/core@^5.1.0 npm ERR! peerinvalid Peer @ionic-native/[email protected] wants @ionic-native/core@^5.1.0 npm ERR! peerinvalid Peer @ionic-native/[email protected] wants @ionic-native/core@^5.1.0 npm ERR! peerinvalid Peer @ionic-native/[email protected] wants @ionic-native/core@^5.1.0 npm ERR! peerinvalid Peer @ionic-native/[email protected] wants @ionic-native/core@^5.1.0 npm ERR! peerinvalid Peer @ionic-native/[email protected] wants @ionic-native/core@^5.1.0 npm ERR! peerinvalid Peer @ionic-native/[email protected] wants @ionic-native/[email protected] npm ERR! peerinvalid Peer @ionic-native/[email protected] wants @ionic-native/[email protected] npm ERR! peerinvalid Peer @ionic-native/[email protected] wants @ionic-native/core@^5.1.0

npm ERR! Please include the following file with any support request: npm ERR! D:\Clients\ionic4\npm-debug.log [ERROR] An error occurred while running subprocess cordova.

config.xml

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.mho.lla" version="0.1.7" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>lla</name>
    <description>lla App</description>
    <author email="hi@ionicframework" href="http://ionicframework.com/">m-hospitality</author>
    <content src="index.html" />
     ... (Abbreviated for brevity) ...
</widget>

package.json

{
  "name": "lity",
  "version": "0.1.1",
  "author": "Ionic Framework",
  "homepage": "https://ionicframework.com/",
   ... (Abbreviated for brevity) ...
}

Answer №1

The reason for my issue was related to my development environment. I had not updated the latest versions of Ionic CLI and Cordova CLI. Once I updated them, all issues were resolved and I successfully built the APK.

$ ionic info

Ionic:

   Ionic CLI                     : 5.2.4 (C:\Users\Sampath\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.4.0
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.2.3
   @angular/cli                  : 7.2.3
   @ionic/angular-toolkit        : 1.2.0

Cordova:

   Cordova CLI       : 9.0.0 (<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d3b0bca1b7bca5b2febfbab193eafde3fde2">[email protected]</a>)
   Cordova Platforms : android 8.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 20 other plugins)

Utility:

   cordova-res : not installed
   native-run  : 0.2.5

System:

   NodeJS : v12.4.0 (C:\Program Files\nodejs\node.exe)
   npm    : 2.15.12
   OS     : Windows 10

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The specified type '{ flag: boolean; }' cannot be assigned to the type 'IntrinsicAttributes & boolean'

Just delving into TypeScript and I've hit a snag when trying to pass an element to another component. Feeling lost on how to proceed. Error lurking in Cards component export default function MySpecialProject() { const [toggle, setToggle] = useState ...

Different Port Options for an Alternative to npm's http-server

In our various projects, we utilize http-server and Express to serve different components on different ports. For example, the user interface may be on port 8080, while some API endpoints are on port 4040. However, as I frequently have multiple projects r ...

Can we define the input and return types for functions using httpsCallables?

I have implemented a callable function in my app to update user claims. The functions are written in Typescript and I have used an interface to define the required data shape for the function. My objective is to make it easier for any developer on the tea ...

Creating a function in Angular to locate each object based on its ID

Hello there, I am currently working on creating a method called findChildByIdInData(data:any, childId:string). This method will take in a JSON main node with children that have unique IDs, and the goal is to find a specific object based on the ID provided ...

A guide to incorporating dhtmlx scheduler into your Angular 4 project

Currently, I am utilizing dhtmlx scheduler to handle my events. While I was able to import the necessary js files successfully, I have encountered an issue when it comes to saving data in the database. My backend is built using Spring Boot framework. Can ...

Dealing with various node types in a parse tree using TypeScript: Tips and Tricks

I am in the process of converting my lexer and parser to TypeScript. You can find the current JavaScript-only code here. To simplify, I have created an example pseudocode: type X = { type: string } type A = X & { list: Array<A | B | C> } ty ...

Every time I clear the information, it seems to be instantly replaced with new data. How can I prevent it from constantly refilling?

When I press the remove button on my application, it successfully deletes the data in a field. However, it also automatically adds new data to the field which was not intended. I am seeking assistance on how to keep those fields empty after removing the ...

ERROR: Module 'jquery' not found in path 'C:....' when using Gulp and Browserify

Encountering an error: Error: Module 'jquery' not found in path 'F:...\newstyle\assets\lib\helper\html\img\js' at C:\Users...\AppData\Roaming\npm\node_modules&bs ...

I need help figuring out how to showcase the following object in an Angular 5 HTML file

The console screenshot above shows an object with two values: users and tickers, each being an array of values. How can I display these values in an Angular 5 HTML template similar to the screenshot above? I attempted to use ngFor but encountered errors. ...

make node-sass utilize lib-sass version 3.6.0

In my current setup, I am utilizing node-sass 4.13.1 with libsass 3.5.4. However, for security purposes, it is crucial to upgrade libsass to version 3.6.0 while keeping the node-sass version unchanged. How can this update be implemented? The traditional m ...

Utilizing process.env in TypeScript can be a bit tricky as dot notation is not effective for accessing its properties

When I set my scripts to: "start": "NODE_ENV=development nodemon dist/Server.js", I am encountering an issue when trying to access NODE_ENV in my code. Both dot and bracket notation return undefined: The dependencies in my project are: "@types/node": "^8. ...

Utilizing child component HTTP responses within a parent component in Angular: a comprehensive guide

As a newcomer to Angular, I find myself struggling with http requests in my application. The issue arises when I have component A responsible for retrieving a list of IDs that need to be accessed by multiple other components. In component B, I attempted t ...

Identify alterations in a variable and trigger an event

I have a button labeled 'Refresh Data' that triggers the refreshBatchData() function: refreshBatchData(){ this.homeService.refreshData().subscribe(data => { this.batchSpotData = data; }) } After receiving data in batchSpo ...

PNG file is not displayed on React TSX page despite absence of any errors

I've implemented this initial design template from GitHub (https://github.com/vikpe/react-webpack-typescript-starter). Additionally, I'm utilizing react-bootstrap and have a container that includes a backgroundImage. const heroImage = require(&q ...

How can union types be used correctly in a generic functional component when type 'U' is not assignable to type 'T'?

I've been researching this issue online and have found a few similar cases, but the concept of Generic convolution is causing confusion in each example. I have tried various solutions, with the most promising one being using Omit which I thought would ...

Angular2 - trigger an HTTP GET request from a different component

At my workplace, I mainly use AngularJS (1.5) but recently ventured into creating my first Angular2 application. However, I've encountered a slight issue with observables. The service I'm working with is the TicketService: import { Injectable, ...

JSPM fails to load dependencies correctly

I have made a fork of the official Bootstrap repository (4.0.0-alpha.6) in order to switch from Grunt to Gulp, and to customize Bootstrap for our specific requirements. The project we are working on utilizes JSPM for package management. However, when atte ...

A personalized command line interface that mimics the functionality of "npm install" but enables the installation of libraries in a directory other than the standard "node_modules"

As I delve into the world of NodeJS, I've come to understand that running "npm install" results in libraries being installed into a directory called "node_modules". However, my goal is to create a similar process but through my own CLI. Instead of usi ...

Tips on updating the content of an HTML element dynamically when it is already being populated using *ngFor

I have created an HTML component that utilizes *ngFor to dynamically generate HTML elements. This results in a total of 3 tags being generated when the code is run. I have included data such as subject in the component file which updates dynamically, how ...

Understanding how to pinpoint a particular request within an Angular 5 HTTP Interceptor

Currently utilizing the HTTPInterceptor feature in Angular 5 and things are running smoothly when it comes to cloning http-requests and sending them to the backend server. The issue arises with a particular GET request that polls the server for data every ...