首页 > win7下为了编译Bootstrap,安装grunt时,执行到npm install时报错。

win7下为了编译Bootstrap,安装grunt时,执行到npm install时报错。

想在本机上装Bootstrap的源码,需要安装Grunt。
为此,依次安装了nodejs(v4.2.2 LTS), git。
然后,执行npm install -g grunt-cli,貌似也成功了。
(执行:grunt -version,能看到 grunt-cli v0.1.13)

然后在下载了Bootstrap源码,解压,进入其目录
执行:npm install时,报错:

npm WARN addRemoteGit Error: not found: git
npm WARN addRemoteGit     at F (D:\front\soft\nodejs\node_modules\npm\node_modules\which\which.js:73:28)
npm WARN addRemoteGit     at E (D:\front\soft\nodejs\node_modules\npm\node_modules\which\which.js:76:29)
npm WARN addRemoteGit     at D:\front\soft\nodejs\node_modules\npm\node_modules\which\which.js:84:16
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:82:15)
npm WARN addRemoteGit  twbs/grunt-sed#v0.2.0 resetting remote C:\Users\Administrator\AppData\Roaming\npm-cache\_git-remotes\git-github-com-twb
npm ERR! git clone --template=C:\Users\Administrator\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/twbs/grunt-se
npm ERR! git clone --template=C:\Users\Administrator\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/twbs/grunt-se
npm WARN addRemoteGit Error: not found: git
npm WARN addRemoteGit     at F (D:\front\soft\nodejs\node_modules\npm\node_modules\which\which.js:73:28)
npm WARN addRemoteGit     at E (D:\front\soft\nodejs\node_modules\npm\node_modules\which\which.js:76:29)
npm WARN addRemoteGit     at D:\front\soft\nodejs\node_modules\npm\node_modules\which\which.js:84:16
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:82:15)
npm WARN addRemoteGit  twbs/grunt-sed#v0.2.0 resetting remote C:\Users\Administrator\AppData\Roaming\npm-cache\_git-remotes\https-github-com-t
npm ERR! git clone --template=C:\Users\Administrator\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://github.com/twbs/grunt-
npm ERR! git clone --template=C:\Users\Administrator\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://github.com/twbs/grunt-
npm WARN addRemoteGit Error: not found: git
npm WARN addRemoteGit     at F (D:\front\soft\nodejs\node_modules\npm\node_modules\which\which.js:73:28)
npm WARN addRemoteGit     at E (D:\front\soft\nodejs\node_modules\npm\node_modules\which\which.js:76:29)
npm WARN addRemoteGit     at D:\front\soft\nodejs\node_modules\npm\node_modules\which\which.js:84:16
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:82:15)
npm WARN addRemoteGit  twbs/grunt-sed#v0.2.0 resetting remote C:\Users\Administrator\AppData\Roaming\npm-cache\_git-remotes\git-github-com-twb
npm ERR! git clone --template=C:\Users\Administrator\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:twbs/grunt-sed.
npm ERR! git clone --template=C:\Users\Administrator\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:twbs/grunt-sed.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\\front\\soft\\nodejs\\node.exe" "D:\\front\\soft\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.2.2
npm ERR! npm  v2.14.7
npm ERR! code ENOGIT

npm ERR! not found: git
npm ERR!
npm ERR! Failed using git.
npm ERR! This is most likely not a problem with npm itself.
npm ERR! Please check if you have git installed and in your PATH.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\front\htmlcss\bootstrap\soft\bootstrap-3.3.5\npm-debug.log

看提示,好像是git的问题。
可以我已经安装了git,而且也加入到了PATH里面。
命令行敲:git --version
可以显示:git version 1.9.5.msysgit.0


1,grunt-cli安上了 grunt还没安上,执行npm install grunt@0.4.3

2,不用手动下载bootstrap,项目目录下执行npm install bootstrap就好

【热门文章】
【热门文章】