美文网首页
Unexpected end of JSON input whi

Unexpected end of JSON input whi

作者: HT_Jonson | 来源:发表于2018-09-04 11:14 被阅读0次

    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
    不过淘宝的源貌似换地址了,我一直用国外的,感觉还行,要有飞跃工具
    

    相关文章

      网友评论

          本文标题:Unexpected end of JSON input whi

          本文链接:https://www.haomeiwen.com/subject/mqhgwftx.html