您好,我有以下问题,当我尝试在我的反应应用程序中安装任何节点包时,我收到此错误:
npm ERR! path C:UsersearthDesktopProjectDAPPclientnode_moduleswebsocket
npm ERR! code EISGIT
npm ERR! git C:UsersearthDesktopProjectDAPPclientnode_moduleswebsocket: Appears to be a git repo or submodule.
npm ERR! git C:UsersearthDesktopProjectDAPPclientnode_moduleswebsocket
npm ERR! git Refusing to remove it. Update manually,
npm ERR! git or move it out of the way first.
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersearthAppDataRoamingnpm-cache_logs2019-04-01T19_35_16_846Z-debug.log
而且我无法安装任何软件包,我该如何解决?
好的,我刚刚解决了。它似乎总是这样工作:当寻找解决方案几个小时时,你什么也没找到。但是一旦你在StackOverflow上发帖,你就会自己找到解决方案。
无论如何,问题是有一个.git文件夹C:UsersearthDesktopProjectDAPPclientnode_moduleswebsocket
.我手动删除了它,现在安装软件包可以了。
我尝试了三次删除node_modules
并package-lock.json
但没有成功。我尝试通过突击队和手动删除,但没有工作。
我发现使其工作的唯一方法是在删除node_modules
和package-lock.json
后使用yarn install
而不是npm install
.如果你没有纱线或不知道这是什么,你可以看看纱线包网站