-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cordova 10 error when adding or removing platform #543
Comments
Problem appears to be coming from a sub-dependency. My first guess is that a sub-dependency didn't get updated properly on your upgrade. This can happen sometimes when doing upgrades because of how NPM and package locks work... Can you try the following:
If you use a global cordova installation, then do:
The above will forcefully remove all your dependencies, platforms and plugins. If you made any custom modifications to your platform(s), it is important you backup those changes.. Then, it will reinstall your dependencies. The platform add command will restore your cordova plugins. The result is everything is installed from scratch. Let me know if this helps. |
Thanks, but I tried all that, before trying a new project in a new Node install (with nvm). I reckoned the new project in clean install would remove the possibility of lingering relics, but I still got the error. |
The problem is this commit from a dependency of cordova-cli: sebhildebrandt/systeminformation@44da17c It sets an because |
Geez, fixing a prototype pollution issue in a library by freezing the But seriously, I think the fix here is to report this as an issue in |
I at least bumped them about the issue here: sebhildebrandt/systeminformation#443 |
Well spotted, thanks!
and installing cordova locally as well to run the following just to get stuff running locally again.
|
I just raised PR #544 from the web GUI as a quick workaround to pin [email protected], not yet tested. If anyone else has a better solution then please feel free to raise it. I should be able to test it in the next 1-2 days in case no one else wants to pick this up. As I said in PR #422, this would not have happened if we had been using npm-shrinkwrap.json. |
Upstream issue just (well, an hour ago) got fixed, so a simple reinstall of cordova should fix the issue :) |
Thank you @RianFuro for leading communications and thank you @sebhildebrandt for your prompt action. |
Glad I could help clear this up 🙇 |
@RianFuro is the Cordova hero of the day! |
Thank you everyone! 😄 |
Bug Report
Problem
Updating an existing project from Cordova 9 to 10, I get an error when trying to add or remove a platform. Then tried with new Ionic project in clean Node installation, and get the same error.
What is expected to happen?
The Android platform is added to the project.
The Android platform is removed from the project (or a message saying it's not part of the project).
What does actually happen?
Information
Command or Code
Environment, Platform, Device
Mac
Version information
MacOS 10.15.7
Node 12.20.0 and 10.15.3 - same behaviour in both.
Cordova CLI 10.0.0
Ionic CLI 6.12.2
Checklist
The text was updated successfully, but these errors were encountered: