-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[BUG] uninstalling an optional peer dep doesnt remove it #4737
Comments
What does |
It is an optional peer dependency. I should be able to uninstall it (it is not automatically installed when doing just |
Interesting edge case, thanks. |
Thanks for the report! I've also confirmed this with the following: ❯ npm i typeorm
added 63 packages, and audited 64 packages in 13s
❯ npm ls sqlite3
4737@1.0.0 /Users/lukekarrys/Documents/npm-sandbox/4737
└── (empty)
❯ npm i sqlite3
added 110 packages, and audited 174 packages in 4s
❯ npm explain sqlite3
sqlite3@5.0.2
node_modules/sqlite3
sqlite3@"^5.0.2" from the root project
peerOptional sqlite3@"^5.0.2" from typeorm@0.3.6
node_modules/typeorm
typeorm@"^0.3.6" from the root project
❯ npm ls sqlite3
4737@1.0.0 /Users/lukekarrys/Documents/npm-sandbox/4737
├── sqlite3@5.0.2
└─┬ typeorm@0.3.6
└── sqlite3@5.0.2 deduped
❯ npm uninstall sqlite3
up to date, audited 174 packages in 672ms
❯ npm ls sqlite3
4737@1.0.0 /Users/lukekarrys/Documents/npm-sandbox/4737
└─┬ typeorm@0.3.6
└── sqlite3@5.0.2
❯ npm explain sqlite3
sqlite3@5.0.2 optional peer
node_modules/sqlite3
peerOptional sqlite3@"^5.0.2" from typeorm@0.3.6
node_modules/typeorm
typeorm@"^0.3.6" from the root project |
Is there a way to work around this in the meantime? I have some leftover optional peer dependencies that are causing issues due to version incompatibilities and I am hesitant to delete the whole package-lock.json just to fix this. |
I was experiencing the same while trying to remove the protractor (an optional peer for @angular-devkit/build-angular). Unfortunately I haven't found any other solution except tinkering with package-lock.json |
Don't need to. Open Had this issue with leftover |
Simpler (but might not be ideal for everyone): delete Note: we could think that deleting |
I've just had this with |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Uninstalling a package does not remove it from the
node_modules
folder, and does not remove it from package-lock.json.Expected Behavior
https://docs.npmjs.com/cli/v8/commands/npm-uninstall
Steps To Reproduce
Environment
The text was updated successfully, but these errors were encountered: