apache/cordova

Package.json is updated incorectly when adding platform?

Closed this issue · 3 comments

Bug Report

When I use a clean installation of my project and run cordova platform add android my package.json file gets changed significantly, and incorrectly.

What is expected to happen?

package.json should be respected

What does actually happen?

package.json get overwritten. Also dependencies are getting the wrong version

Information

It might be because I have the packages registered in dependencies and not devDependencies, I don't know...

Command or Code

Project can be found here:
https://github.com/IsraelHikingMap/Site/tree/master/IsraelHiking.Web

Environment, Platform, Device

Currently testing on Android

Version information

Cordova cli: 10.0
cordova-android: 9.0

This started happening after the upgrade to 10.0 and android 9.0.

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Seems like when the cordova plugins are in the devDependencies it works as expected. I guess that it should be written somewhere in the release notes?

@jcesarmobile was this fixed in any way? There's a real problem in the definition of where things should be I order to be respected by cordova...
For example when setting the cordova-ios to be a git address it does not get respected when in dev dependencies, only in dependencies...
Took me quite a while to get everything working after the upgrade to cordova 10...

You have reported it on cordova-cli, which is the proper repo to report it, so closing this because it’s a duplicate and not the proper place