npm install 安装组件的时候会发生如下错误
image.png
当然你可以选择用
yarn add mobx --save
如果非要使用npm的话 你要清楚一下cache
命令如下:
npm cache clean --force
image.png
image.png
然后你继续就可以了
image.png
或者说你的npm 源出现了问题
查看npm源
npm config get registry
# 默认源
npm config set registry https://registry.npmjs.org
# https -> http,这样网速就会好很多
npm config set registry http://registry.npmjs.org
# 如果还不能下载,就切换成淘宝源
npm config set registry https://registry.npm.taobao.org
不过淘宝的源貌似换地址了,我一直用国外的,感觉还行,要有飞跃工具
网友评论