清除缓存后,npm无法正常工作 [英] npm not working after clearing cache

查看:504
本文介绍了清除缓存后,npm无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

清除缓存之前

npm cache clear

npm运行正常.清除缓存后,它不起作用. 下面的错误日志表明Internet连接存在问题,但Internet连接就可以了. 这个问题不仅会发生在Bower上,还会发生在任何模块上.

npm is working fine. After clearing cache, it is not working. The error log below suggest problem with internet connectivity but internet connection is just fine. This problem does not only happen for bower but for any modules.

这是流程的输出:

> sudo npm install -g bower Password: npm http GET
> https://registry.npmjs.org/bower npm http GET
> https://registry.npmjs.org/bower npm http GET
> https://registry.npmjs.org/bower npm ERR! network connect ETIMEDOUT
> npm ERR! network This is most likely not a problem with npm itself npm
> ERR! network and is related to network connectivity. npm ERR! network
> In most cases you are behind a proxy or have bad network settings. npm
> ERR! network npm ERR! network If you are behind a proxy, please make
> sure that the npm ERR! network 'proxy' config is set properly.  See:
> 'npm help config'
> 
> npm ERR! System Darwin 12.5.0 npm ERR! command
> "/usr/local/Cellar/node/0.10.16/bin/node" "/usr/local/bin/npm"
> "install" "-g" "bower" npm ERR! cwd /Users/username npm ERR!
> node -v v0.10.16 npm ERR! npm -v 1.3.8 npm ERR! syscall connect npm
> ERR! code ETIMEDOUT npm ERR! errno ETIMEDOUT npm ERR! npm ERR!
> Additional logging details can be found in: npm ERR!    
> /Users/username/npm-debug.log npm ERR! not ok code 0

推荐答案

这对我有用:

npm cache clean --force 

这篇关于清除缓存后,npm无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆