apache / apache/cordova-cli

Package.json is updated incorectly when adding platform?

Open
#537 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
967
Forks
344
Avg merge
8h 41m
Merged PRs (30d)
9

Description

Copied from https://github.com/apache/cordova/issues/252
# 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

- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue using the linked IsraelHikingMap/Site project with a clean installation and `cordova platform add android`. Compare the resulting package.json with its original dependencies and versions, then trace the platform-add package update behavior. Done means package.json is preserved appropriately and dependency versions are not changed incorrectly.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript, nodejs
Domain
cli, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.