Feature Request: Make `ionic repair` only remove `package-lock.json` with an option
See original GitHub issueCurrently ionic repair
will:
- rm -rf node_modules/ plugins/ platforms/
- rm package-lock.json
- npm i
- 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.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
I took it to mean only work with Cordova.
rm -rf plugins/ platforms/
cordova prepare
Ah I see. So there would not be any option for
node_modules
to be deleted & reinstalled becauseIf that’s the case then 👍