If I run npm ls at the top level of my project, I get a number of extraneous errors. I tried running npm prune but when I run npm ls again the packages are still there.
How do I remove those extraneous packages?
I have package-lock file and I'm running npm 6.4.1.
npm pruneis the command you're looking for and it should remove extra packages (and did in my case).