Skip to content
This repository has been archived by the owner on May 10, 2021. It is now read-only.

delete contents of node_modules but keep the dir itself #1

Merged
merged 2 commits into from
Oct 8, 2019

Conversation

tareksha
Copy link
Contributor

@tareksha tareksha commented Aug 18, 2019

Original PR: zkat/cipm#47

Keep node_modules directory but delete its contents.

In some CI setups node_modules is a special directory, e.g. a mounted folder or a symbolic link. For these setups simply deleting node_modules won't work, or worse will work but break the CI setup. Deleting node_modules is a also a non-trivial deviation from the expected behavior of npm install which means the existing CI setups that are explained above are blocked from migrating to npm ci.

npm ci should minimize violent changes and concentrate on the fact we want to reset the installed dependencies and proceed with the regular flow. Keep node_modules untouched, doesn't matter how it was created.

@tareksha tareksha changed the title Delete modules contents delete modules contents, not the dir itself Aug 18, 2019
@tareksha
Copy link
Contributor Author

@tareksha tareksha changed the title delete modules contents, not the dir itself delete contents of node_modules but keep the dir itself Aug 18, 2019
@ErikHumphrey
Copy link

lgtm

@solinfra-bot
Copy link

running into this issue myself

@claudiahdz claudiahdz merged commit f1330e3 into npm:latest Oct 8, 2019
claudiahdz pushed a commit that referenced this pull request Oct 8, 2019
claudiahdz pushed a commit that referenced this pull request Oct 8, 2019
claudiahdz pushed a commit that referenced this pull request Oct 8, 2019
claudiahdz pushed a commit that referenced this pull request Oct 8, 2019
claudiahdz pushed a commit that referenced this pull request Oct 9, 2019
claudiahdz pushed a commit that referenced this pull request Oct 9, 2019
claudiahdz pushed a commit that referenced this pull request Oct 9, 2019
claudiahdz pushed a commit that referenced this pull request Oct 9, 2019
@tareksha tareksha deleted the delete_modules_contents branch October 22, 2019 11:55
cpennington added a commit to cpennington/configuration that referenced this pull request Nov 4, 2019
…en node_modules is mounted (like in docker)

12.13.0 is the first version of node that includes npmcli 4.0.7, which
includes npm/libcipm#1, which means that `npm ci`
will work correctly in circumstances where `node_modules` is mounted
rather than being a standard directory.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants