'错误:找不到:git'代码:'ENOGIT'安装凉亭时

时间:2015-12-01 12:57:22

标签: install bower-install

我正在使用安装了git和node的windows 10。跑步:

npm install -g bower

结果

npm WARN addRemoteGit Error: not found: git
npm WARN addRemoteGit     at F (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:78:19)
npm WARN addRemoteGit  sheerun/fs-write-stream-atomic#v1.0.4-fix resetting remote C:\Users\Muhammet Akkus\AppData\Roaming\npm-cache\_git-remotes\git-github-com-sheerun-fs-write-stream-atomic-git-v1-0-4-fix-7baaaaefc7e8a6f2fd1f4fdbc8e4b6e7 because of error: { [Error: not found: git] code: 'ENOGIT' }
npm ERR! git clone --template=C:\Users\Muhammet Akkus\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/sheerun/fs-write-stream-atomic.git C:\Users\Muhammet Akkus\AppData\Roaming\npm-cache\_git-remotes\git-github-com-sheerun-fs-write-stream-atomic-git-v1-0-4-fix-7baaaaefc7e8a6f2fd1f4fdbc8e4b6e7: undefined

...

3 个答案:

答案 0 :(得分:4)

您应该尝试以root身份运行此命令。在Windows上,以管理员身份启动CommandLine,在Mac或Linux下使用

sudo npm install -g bower 

答案 1 :(得分:2)

从git-bash安装git并运行npm install对我有用。确保您在正确的目录中。

请参阅此处以获取解决方案 git is not installed or not in the PATH

答案 2 :(得分:0)

我使用Windows,并且当我想安装react-native-router-flux时遇到相同的问题,对我来说,当我使用git bash而不是命令行来安装它时,可以解决此问题,希望对您有所帮助。 / p>

相关问题