Skip to content

[BUG] uninstall does not remove --no-save installed package from node_modules #2309

Closed
npm/arborist
#194
@raphinesse

Description

@raphinesse

Current Behavior:

If I install a package using the --no-save option, it is not removed from node_modules/ upon its uninstallation.

Expected Behavior:

If I install a package using the --no-save option, it should get removed from node_modules/ upon its uninstallation.

NB: this is also how npm 6 behaves.

Steps To Reproduce:

  1. Run the following
cd $(mktemp -d)
mkdir node_modules
npm i q --no-save
npm un q --no-save
  1. Observe that node_modules/q still exists.

Omitting the --no-save option for the uninstallation command yields the same result. Substituting mkdir node_modules with npm init --yes makes no difference either.

Environment:

  • OS: Ubuntu 18.04.5 & 19.10
  • Node: 12.19.0 & 15.4.0
  • npm: 7.0.15 & 7.1.1

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingRelease 7.xwork is associated with a specific npm 7 releasesemver:patchsemver patch level for changes

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions