Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does npm list -g lead to npm ERR! missing error?

Tags:

node.js

npm

npm returns the following message after using npm list -g

npm ERR! missing: atom-package-manager@*, required by undefined@undefined
npm ERR! missing: opal-npm-wrapper@git://github.com/anthonny/opal-npm-wrapper.git#0.1.1, required by [email protected]
npm ERR! missing: xmlhttprequest@~1.6.0, required by [email protected]

screenshot:

like image 260
hugemeow Avatar asked May 24 '15 09:05

hugemeow


People also ask

Why npm install is showing error?

The npm ERR! code 1 error usually occurs when you run the npm install command. This cause of this error is that one of the dependencies you define in your package. json file fails to be installed properly on your computer.

What does npm err missing script start mean?

The npm error missing script: “start” means that npm can't execute the “start” script from your package. json file. This error happens when you run the npm start or npm run start command from the command line.


3 Answers

I know this an old question but I've been strugging with a similar issue and figure I'd at least add what worked for me...

Problem

Running npm list -g lists all packages as expected and then throws a variety of errors including the missing errors, as mentioned above, and, for me at least, a bunch of invalid and extraneous errors such as this:

extraneous: [email protected] /usr/local/lib/node_modules/npm/node_modules/aws-sign2

I tried a bunch of solutions including npm upgrade, npm prune, as well as installing missing packages, which for me was semver:

missing: semver@2 || 3, required by [email protected]

I'm still not sure of the exact cause for these errors, though I believe this happened when I upgraded to 3.3.6.

Solution

After some headache I ran:

npm update -g --verbose

which upgraded me from v3.3.6 to v3.5.3 and got rid of all the errors. Note that the --verbose is not necessary but helpful to see what exactly is happening. Now my npm list -g returns a clean output:

/usr/local/lib
├── [email protected]
└── [email protected]

Hope this helps someone, please comment if I've stated any inaccuracies or if there's something I can add here.

like image 142
Greg Venech Avatar answered Oct 20 '22 11:10

Greg Venech


For anyone having the same problem, try to run:

npm dedupe

for more info about npm dedupe please refer to the documentation. https://docs.npmjs.com/cli/dedupe.html

like image 6
designdust Avatar answered Oct 20 '22 11:10

designdust


Remove package-lock.json in /usr/local/lib.

like image 2
bruinspaw Avatar answered Oct 20 '22 12:10

bruinspaw