This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
script: Remove automatic deduping from postinstall #924
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requirements
Description of the Change
This PR removes a couple of lines in
script/postinstall.cmd
andscript/postinstall.sh
that performed annpm dedupe
toward the end of thepostinstall
script when installingapm
itself.Alternate Designs
npm dedupe
manually?)381120d..a93c88a
I think off by default is justified, but removing the capability altogether is even cleaner to simplify the code. If a user wants to ensure apm is installed with maximum deduping, they can delete
apm
'snode_modules
folder and itspackage-lock.json
, and reinstall.In my experience, the extra
npm dedupe
run makes no difference.Benefits
Faster installs of
apm
itself (by skipping deduping). No more missing dependencies when installingapm
withnpm ci
; Makes installingapm
withnpm ci
possible without having to set theNO_APM_DEDUPE
env var anymore.Possible Drawbacks
(Very small?) chance of missing some deduping/filesize savings when upgrading apm in the Atom repo.
To give modern
npm
the easiest time with its own automated/internal deduping when updatingapm
in the Atom repo, I recommend deletingapm
'snode_modules
andpackage-lock.json
, then updating itspackage.json
to the newestapm
, then runningnpm install --global-style
as usual.Verification Process
As intended with this change,
npm dedupe
is no-longer run during thepostinstall
script. I have tried this many times locally, and this has been in the community fork for several months now, including in CI.Applicable Issues
Upstreaming this PR from the
atom-community
fork ofapm
: atom-community#71As requested by @sadick254 in atom/atom#22450 (review).