在 linux 中安装 nodegit 时出错

问题描述

我输入了 npm install nodegit 并收到以下错误

npm ERR! Linux 3.10.0-514.2.2.el7.x86_64
npm ERR! argv "/usr/bin/node" "/bin/npm" "install" "nodegit"
npm ERR! node v6.9.2
npm ERR! npm  v3.10.9
npm ERR! path /opt/portal_server/node_modules/nodegit
npm ERR! code EIsgiT

npm ERR! git /opt/portal_server/node_modules/nodegit: Appears to be a git repo or submodule.
npm ERR! git     /opt/portal_server/node_modules/nodegit
npm ERR! git Refusing to remove it. Update manually,npm ERR! git or move it out of the way first.

npm ERR! Please include the following file with any support request:
npm ERR!     /opt/portal_server/npm-debug.log

您能否提出解决错误方法

解决方法

试试运行这个

sudo rm -rf node_modules/*/.git/

然后尝试安装 nodegit