Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Fix uninstall leaving nested modules directories with .bin #11181

Closed
wants to merge 2 commits into from

Conversation

chrisirhc
Copy link
Contributor

Fixes #10887 #10938

I haven't added a test for the main modules' node_module/.bin, this removes node_module/*/node_modules/.bin so that empty modules can be removed.

@othiym23 othiym23 added this to the 3.x milestone Jan 18, 2016
@othiym23
Copy link
Contributor

Hmm... we may want to hoist and name that error handler to a function declaration, and @iarna should review this because she's the expert on the installer, but this looks good to me aside from those concerns. Thanks for including a test!

Previously, installed packages that contained node_modules with a .bin
directory woudn't get cleaned up correctly. After unbuild of that particular
package, npm would complain with ENOENT errors because the package directory
would be empty (without package.json), as it only contains the leftover
`node_modules/.bin` directory.
@chrisirhc
Copy link
Contributor Author

Sounds good. I updated the PR to use a function declaration, cleaned up the commits and cleaned up the duplicate cb() call logic. I'll await more reviewing before I squash the changes.

@iarna iarna modified the milestones: next, 3.x Jan 20, 2016
iarna pushed a commit that referenced this pull request Jan 20, 2016
Previously, installed packages that contained node_modules with a .bin
directory woudn't get cleaned up correctly. After unbuild of that particular
package, npm would complain with ENOENT errors because the package directory
would be empty (without package.json), as it only contains the leftover
`node_modules/.bin` directory.

PR-URL: #11181
Credit: @chrisirhc
Reviewed-By: @othiym23
Fixes: #10887
Fixes: #10938
iarna pushed a commit that referenced this pull request Jan 21, 2016
Previously, installed packages that contained node_modules with a .bin
directory woudn't get cleaned up correctly. After unbuild of that particular
package, npm would complain with ENOENT errors because the package directory
would be empty (without package.json), as it only contains the leftover
`node_modules/.bin` directory.

PR-URL: #11181
Credit: @chrisirhc
Reviewed-By: @othiym23
Fixes: #10887
Fixes: #10938
@iarna
Copy link
Contributor

iarna commented Jan 25, 2016

This was merged to 3.5.5! =)

@iarna iarna closed this Jan 25, 2016
@chrisirhc chrisirhc deleted the fix-bin-leftover branch January 26, 2016 00:59
@chrisirhc
Copy link
Contributor Author

Hooray! 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants