本文档包含以下可能与影响 npm 所有使用的问题相关的配置文件:每个用户的配置文件 (~/.npmrc)全局配置文件 (${HOME}/.npm-packages/npmrc)npm 内置配置文件 (/path/to/npm/npmrc)评论这篇文章的其他人发现删除 ~/.npmrc 文件成功如果您在类似 un*x 的平台上运行,例如支持 bash 的 OSX 或 Linux - 我会推荐节点版本管理器.这允许您运行多个版本的 node 和 npm - 您可以完全删除和重新安装版本.https://github.com/creationix/nvmNo 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/npmMove 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~/.npmthen reinstalled. still receiving the same error. 解决方案 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.htmlSome configuration files are also used:https://www.npmjs.org/doc/files/npmrc.htmlThis document has the following configuration files that might be relevant to issues that affect all uses of npm:per-user config file (~/.npmrc)global config file (${HOME}/.npm-packages/npmrc)npm builtin config file (/path/to/npm/npmrc)Other people commenting on this post have found success removing the ~/.npmrc fileIf 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 这篇关于由于 EEXIST 错误,NPM 无法运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-06 14:47