美文网首页
【报错】react 使用npx create-react-app

【报错】react 使用npx create-react-app

作者: suesoft | 来源:发表于2020-03-27 11:02 被阅读0次

    使用官方步骤npx create-react-app my-app创建React App,无文件夹my-app生成,且报错

    Installing react, react-dom, and react-scripts width cra-template...
    npm ERR! Unexpected end of JSON input while parsing near ...ps://registry.npm.js.o
    npm ERR! A complete log of this run can be found in:
    npm ERR! C:\Users\Administratore\AppData\Roaming\npm-cache_logs\2020-03-25T02_54_03_429Z-debug.log
    ...

    1585106680.jpg

    切换为淘宝镜像再次运行就ok 了,如下:

    //切换为淘宝源
    npm config set registry https://registry.npm.taobao.org
    // 验证是否配置成功
    npm config get registry
    // 重新创建
    npx create-react-app my-app
    
    1585106966.jpg

    相关文章

      网友评论

          本文标题:【报错】react 使用npx create-react-app

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