No matter what I do with npm
, remove it, re-install it, re-hash, etc, i still get this error when I try to run anything related to npm
:
prompt$ npm
------
npm ERR! EEXIST, mkdir '/usr/local/bin/npm'
File exists: /usr/local/bin/npm
Move it away, and try again.
What is the problem and how do I fix it?
I've deleted:
/usr/local/bin/node
/usr/local/bin/npm
~/.npm
then reinstalled. still receiving the same error.
The Npm command not found error can appear when you install or upgrade npm. On Windows, the cause of this error could be that a PATH or system variable is not correctly set. The error can also occur if you do not have npm or Node. js installed, have an outdated version, or have permission issues.
The Missing script: "start" error occurs for multiple reasons: Missing a start script in the scripts section of your package. json file. Opening your IDE or shell in a directory that doesn't contain your package.
I can only suggest a complete wipe of node.js and npm and reinstall. Fortunately node and npm are fairly lightweight packages so this is not too onerous.
I know you said you have reinstalled, but I suggest you manually remove all the folders that it uses to store information, in case some corrupted file is being left that is causing this. A guide to all the folder npm uses is found here:
https://www.npmjs.org/doc/files/npm-folders.html
Some configuration files are also used:
https://www.npmjs.org/doc/files/npmrc.html
This document has the following configuration files that might be relevant to issues that affect all uses of npm:
Other people commenting on this post have found success removing the ~/.npmrc file
If you are running on an un*x like platform, like OSX or Linux which support bash - I would recommend node version manager. This allows you to run multiple versions of node and npm - and you can can remove and reinstall versions completely.
https://github.com/creationix/nvm
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