Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm removes packages on install #409

Closed
darcyclarke opened this issue Nov 8, 2019 · 1 comment
Closed

npm removes packages on install #409

darcyclarke opened this issue Nov 8, 2019 · 1 comment
Labels
Bug thing that needs fixing

Comments

@darcyclarke
Copy link
Contributor

  Original bug ticket: [https://npm.community/t/9432](https://npm.community/t/9432)
  Originally filed: 2019-08-12T14:27:35.621Z
@darcyclarke darcyclarke added Bug thing that needs fixing Community labels Nov 8, 2019
@jacobq
Copy link

jacobq commented Dec 11, 2019

Looks like this is also nearly the same as the problem described in npm/npm#17379 (comment). This is still plaguing me in 6.13.3 in that running npm install <something> causes dependencies specified with GitHub repositories instead of semver strings in package.json to get removed from node_modules.

Supposedly, using --no-package-lock option should prevent this behavior, but it made no difference when I tried it just now. However, even if it did, the overall developer experience would still be poor. Consider the use case of using yarn and tracking yarn.lock instead of package-lock.json (having multiple/competing lock files is not recommended). AFAICT, yarn has no --no-save equivalent so it seems reasonable that a developer might use npm install --no-save [--no-package-lock] some-package to temporarily install a module for experimentation. As others have noted, it is quite surprising to find that doing a one-off installation of a module should remove anything, especially things that are almost completely unrelated (that is, aside from happening to be part of the same project).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing
Projects
None yet
Development

No branches or pull requests

2 participants