清除缓存之前
npm cache clear
Run Code Online (Sandbox Code Playgroud)
npm工作正常.清除缓存后,它无法正常工作.下面的错误日志表明互联网连接问题但互联网连接很好.这个问题不仅发生在凉亭上,也发生在任何模块上.
这是流程的输出:
> 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
Run Code Online (Sandbox Code Playgroud)
Per*_*son 94
它应该是
npm cache clean
Run Code Online (Sandbox Code Playgroud)
请参阅https://www.npmjs.org/doc/cli/npm-cache.html
小智 84
这对我有用:
npm cache clean --force
Run Code Online (Sandbox Code Playgroud)
RBZ*_*RBZ 47
"从npm @ 5开始,npm缓存自我修复了腐败问题,从缓存中提取的数据保证有效.如果你想确保一切都是一致的,请使用
__CODE__
代替."
小智 9
npm cache clean --force
npm cache verify
Run Code Online (Sandbox Code Playgroud)
就是这样
我试着
npm cache clean
Run Code Online (Sandbox Code Playgroud)
但是npm表示npm(> 5)上的较新版本具有自我修复机制,我需要检查npm的每件事都是使用verify
npm cache verify
Run Code Online (Sandbox Code Playgroud)
npm消息:
The npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid.
If you want to make sure everything is consistent, use 'npm cache verify' instead.
Run Code Online (Sandbox Code Playgroud)
但是要强制npm,请使用以下命令:
npm cache clean --force
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
240268 次 |
| 最近记录: |