想在本机上装Bootstrap的源码,需要安装Grunt。
按照官网的表述,在执行npm install时,出现了很多报错。
希望有人指点一下是什么原因?还要装其他的环境吗?
以下为命令行:
F:\Office software2\bootstrap-3.2.0>npm install
npm WARN deprecated grunt-jscs-checker@0.6.2: Package was renamed to 'grunt-jscs
'
npm WARN package.json github-url-from-git@1.1.1 No repository field.
\
phantomjs@1.9.10 install F:\Office software2\bootstrap-3.2.0\node_modules\grun
t-contrib-qunit\node_modules\grunt-lib-phantomjs\node_modules\phantomjs
node install.jsDownloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-wind
ows.zip
Saving to C:\Users\博闻\AppData\Local\Temp\phantomjs\phantomjs-1.9.7-windows.zip
Receiving...
Error making request.
Error: connect ETIMEDOUT
at errnoException (net.js:904:11)
at Object.afterConnect [as oncomplete] (net.js:895:19)
Please report this full log at https://github.com/Medium/phantomjs
npm ERR! phantomjs@1.9.10 install: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs@1.9.10 install script.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls phantomjs
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "F:\Office software2\Node.js\\node.exe" "F:\Office softwar
e2\Node.js\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! cwd F:\Office software2\bootstrap-3.2.0
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
问题分析
单纯的就是
phantomjs
安装出错,这个错误我经常遇到(能遇到用yeoman
的同学真是很开心的事情)你注意它这两句log:
正常的安装过程这里是会出现下载的百分比的,然后一点一点向前推进到100%,如果直接出Err就是这里下载失败
处理方案
处理这个问题很简单,手动去下载
phantomjs-1.9.7-windows.zip
(关于如何手动下载,这个百度或者Google一下)然后把它手动的放到
C:\Users\博闻\AppData\Local\Temp\phantomjs\
目录下,然后你在运行一下npm install
就可以了其实说个题外话,
phantomjs
多用在测试上的,对你build
或者serve
应该是没有妨碍的,即使出错的也可以使用这两个功能