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

Is there a way for me to instruct npm to refrain from making any download requests to the internet?

I am facing an issue while installing npm packages on a machine without internet access. The process first attempts to connect online before resorting to the locally cached versions, which is causing significant slowdowns: npm install gulp -g --verbose n ...

Why does the custom method only trigger once with the addEventListener?

I am attempting to connect the "oninput" event of an input range element to a custom method defined in a corresponding typescript file. Here is the HTML element: <input type="range" id='motivation-grade' value="3" min="1" max="5"> This i ...

Adding a personalized service into a separate service within Angular 2

I am having trouble injecting my own service into another service. While I can inject standard Angular services like Http without any issues, attempting to inject custom services results in an exception. For example, here is how MyService is set up: impo ...

I am interested in preserving a QrCode by converting it into an image

Below is the updated code snippet: [HttpGet("GenerateQrCode")] public ActionResult<string> GenerateQrCode(string sellername, string vatregistration, string timestamp, string invoiceamount, string vatamoun) { string ltr = ((char)0x20 ...

Exploring Query String Retrieval and Data Fetching in Ionic 2 using Angular 4's $

I am struggling to find the information I need, so I'm reaching out for help on how to send a request to a JSON api with parameters encoded in JavaScript. It is crucial that the parameters are properly encoded because the query could contain special ...

Sending Information to Routes - Error: No Routes Found to Match

I recently tried implementing a solution from an article () to pass an ID between modules in order to use it as a search filter. However, I encountered the "cannot match any routes" error and have been struggling for some time since I'm new to Angular ...

There were issues with React's compilation when integrating with antd UI

Whenever I try to compile, errors keep showing up even though I have imported from antd. I can't figure out what the problem is. These are the errors I encounter while compiling: Compiled with problems: ERROR in ./src/components/excelPage.js 130:85- ...

Issue encountered when configuring MongoDB path in Windows 7

Recently, I've started learning about MongoDB. I'm attempting to run mongod in the directory C:\Program Files\MongoDB\Server\3.2\bin but unfortunately, I keep encountering an error message. For reference, here's a s ...

Is it possible for moduleNameMapper to exclude imports made by a module located within node_modules directory?

I am trying to figure out how to make my moduleNameMapper ignore imports from the node_modules directory. The issue is that one of the dependencies, @sendgrid/mail, uses imports starting with ./src/ which causes problems when importing into Jest. My curre ...

Steps for sending data from Angular2 or Angular4 to a Node.js server and saving it in a MySQL database:1. In your

I've scoured the depths of the internet on Google but have come up empty-handed in finding a reliable working example. Any assistance would be greatly appreciated as I am relatively new to Angular2 (angular4). My goal is to have my angular2 applicati ...

How can I determine the version of an NPM package if I can't display it using the nodemon --version command?

I attempted to execute some code in my hyper-terminal by deleting nodemon and then reinstalling it. However, despite these efforts, I am still unable to retrieve the version of nodemon. The error message I received reads as follows: "C:\Users&bso ...

What is the best way to bring in styles for a custom UI library in Angular 2?

In the realm of UI libraries, I find myself facing a dilemma. Upon importing SCSS styles into my components (such as a button), I noticed that if I instantiate the component button twice in the client app (which has my UI library as a dependency), the SCSS ...

Navigating with Angular 4's router and popping up modals

I have an Angular 4 SPA application that utilizes the Angular router. I am looking to create a hyperlink that will open a component in a new dialog using Bootstrap 4. I am able to open modal dialogs from a function already. My question is, how can I achi ...

What could be causing the "directory not empty" error to appear in Podman when running the command "npm install"?

I recently started using Podman and I'm attempting to run a React application with Podman on WSL Ubuntu. Below is the Dockerfile I am using: #building react app FROM node:lts-alpine WORKDIR /home/dcaron/React-Admin\ Podman\ Test/client COPY ...

Having trouble with NPM install because of a node-gyp issue?

We're facing issues with running "npm install" on our project. The error message states that a specific file cannot be located: fatal error C1083: Cannot open include file: 'windows.h' This error seems to be originating from the node-gyp mo ...

Discovering the process of reaching service members through an HTML View

Currently, I am in the process of learning Angular 2 and find myself unsure about the most efficient way to update the view. For instance, let's say I have two components: User and Main. The User component retrieves a list of users from the UserServ ...

Deleting an element from an object in TypeScript

Is there a way in TypeScript to exclude certain elements (e.g. 'id') from an object that contains them? ...

Troubleshooting problem with Angular4's HTTP requests

While working on my Angular 4 application, I am creating an oath guard service to check the validity of tokens. If the token is not valid, I want the user to log in again. Below are the functions I have implemented for this purpose: isLogedIn(){ ret ...

Creating packages for multiple Typescript projects that rely on a shared local module

I am currently developing a series of VSTS extensions, with each extension being its own independent Node project complete with its own package.json file and node_modules folder. The structure of the folders is as follows: - MyExtension - package.json ...

Utilize a specific component to enclose particular words within a contenteditable div in an Angular project

I have a task at hand where I need to manipulate text input from a contenteditable division, use regex to identify specific words, and then wrap those words within an angular component. Although I have managed to successfully replace the text with the com ...