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

Empty .bin directories are not removed and result in ENOENT errors #10938

Closed
SystemParadox opened this issue Dec 23, 2015 · 1 comment
Closed
Labels
Milestone

Comments

@SystemParadox
Copy link

With npm@3 I am regularly getting ENOENT errors.

When doing npm remove and seemingly also when doing npm install (perhaps because npm is moving things around in the tree?), I end up with empty .bin directories like this:

node_modules/foobar/node_modules/.bin

Where foobar and everything under it is empty, but the .bin wasn't removed. Any other npm install then reports ENOENT for node_modules/foobar/package.json (as per #10471).

Removing all the empty directories fixes it:

rmdir node_modules/foobar/node_modules/.bin
rmdir node_modules/foobar/node_modules/
rmdir node_modules/foobar

Expected behaviour: npm should have removed these directories already.

npm version 3.5.3

Thanks.

@chrisirhc
Copy link
Contributor

Likely related/same as #10887

@othiym23 othiym23 added the bug label Jan 18, 2016
@othiym23 othiym23 added this to the 3.x milestone Jan 18, 2016
iarna pushed a commit that referenced this issue 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 iarna closed this as completed in ea331c8 Jan 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.