octopackjs icon indicating copy to clipboard operation
octopackjs copied to clipboard

npm ls --prod returns duplicates

Open samjudson opened this issue 6 years ago • 0 comments

Hi

Just wanted to say I love this package. However I've come across an issue with its use of the output of npm ls.

Below if a selection of the output of npm ls --parseable --prod on my project:

C:\Git\Project1\node_modules\debug
C:\Git\Project1\node_modules\debug\node_modules\ms
C:\Git\Project1\node_modules\extract-zip
C:\Git\Project1\node_modules\concat-stream
C:\Git\Project1\node_modules\buffer-from
C:\Git\Project1\node_modules\typedarray
C:\Git\Project1\node_modules\extract-zip\node_modules\debug
C:\Git\Project1\node_modules\ms
C:\Git\Project1\node_modules\yauzl

As you can see debug has a sub-module, which is being listed after the main debug top level module (the same for extract-zip).

This means that the files in debug\node_modules\ms are being included in the output zip file twice, which is then causing unzipping to fall over as it attempts to write the same file twice and throwing an exception.

I was going to try to offer a pull request to try to clean this up, but the code in this repository doesn't seem to match the code downloaded from npm, so wasn't able to work out what to do.

samjudson avatar Oct 12 '18 09:10 samjudson