Skip to content

Feature Request: Make ionic repair only remove package-lock.json with an option #4048

Description

@kensodemann

Currently ionic repair will:

  1. rm -rf node_modules/ plugins/ platforms/
  2. rm package-lock.json
  3. npm i
  4. re-add the platforms

Or some variant thereof.

The problem I have with it is the removal of the package-lock.json file, which I believe should only be done under extreme circumstances where-as the rebuilding of plugins/ and platforms/ is basically always safe and is often necessary when upgrading plugins due to Cordova's aggressive caching.

We have run into issues with some enterprise customers where they have used ionic repair in order to fix issues with the plugins only to also accidentally upgrade all of their dependencies at the same time (luckily, in most cases they were using ~, but a few were using ^, which we have coached them not to do, but still...

Given that the most common use case here is the plugins having gotten out of whack, I believe the removal of the package-lock.json file is a bit too aggressive with the exception of very odd cases, and thus should be controlled via an argument to the command.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions