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:
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.
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.
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.
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
Remove package-lock.json
in /usr/local/lib
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With