Couldn't install or uninstall anything with `event-stream@3.3.6` in the tree

help-wanted
priority:low
cli
triaged

(Lenny Martin) #1

What I Wanted to Do

I had to dig out an old codebase that had a dependency which contained in its tree event-stream@3.3.6. This failed for obvious and well-known reasons.

I then tried to fix this by just removing the top-level dependency - we didn’t really need it anyway, and I wanted to make the smallest changes possible to the overall tree.

I was hoping I’d be able to just cut it out of the tree.

What Happened Instead

Attempting to run npm uninstall npm-run-all threw a 404 error on event-stream@3.3.6.

… ok, I’ll update it instead …

Attempting to run npm install npm-run-all@latest also threw the same 404 error.

Turns out there was a second module in my tree that also had event-stream as a dependency, and that meant I couldn’t remove the first module.

So the normally awesome self-healing nature of npm means I can’t now fix this issue unless I can run a single command that removes all instances of the now missing package from the tree. So I had to go spelunking through my package-lock to try to find all instances, and try to come up with such an incantation.

In short, it’d be nice if there was a flag on uninstall so it only uninstalled and didn’t try to heal everything else. I don’t know if this is easy or even possible though.

Reproduction Steps

Details

Platform Info

$ npm --versions
<!-- paste output here -->
$ node -p process.platform
<!-- paste output here -->

(Lars Willighagen) #2

As an aside, could you have run npm ls event-stream to find those instances?


(Lenny Martin) #3

No, that just output:

└── (empty)