duniul / clean-modules

🧹 Clean up/prune unnecessary files and reduce the size of your node_modules directory.
ISC License
107 stars 5 forks source link

intermittent ENOENT errors seen during execution #1

Closed scttl closed 3 years ago

scttl commented 3 years ago

Hi,

When running clean-modules as part of a container build from a node:11.1.0-alpine base image we've periodically run into errors like the following:

{ [Error: ENOENT: no such file or directory, scandir '/usr/src/api/app/node_modules/resolve/test']
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/usr/src/api/app/node_modules/resolve/test' }
Removing intermediate container 04a4039cca36
The command '/bin/sh -c clean-modules --yes ./app/node_modules       --exclude "**/googleapis/build/src/apis/docs/**"       --exclude "**/mongoose/**"       --exclude "**/grpc/**"' returned a non-zero code: 1

The actual file not being found varies from one run to the next, and this error doesn't always occur but it appears there may be a timing issue running this? We saw a few failures in files under the grpc package so that's why we added that exclusion. Has anyone else encountered this?

duniul commented 3 years ago

@scttl Hmm, I haven't experienced it myself. That said, since the goal is to remove the files/dirs it definitely shouldn't throw an error for paths that no longer exist!

I'll have a fix up in a bit 👍

duniul commented 3 years ago

:tada: This issue has been resolved in version 1.0.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

duniul commented 3 years ago

@scttl Feel free to reopen this if you still see the issue on version 1.0.4!

scttl commented 3 years ago

wow, fast turn around, really appreciate that! Tested 1.0.4 on a few builds now and so far everything looks good, thank you!

duniul commented 3 years ago

:tada: This issue has been resolved in version 2.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: