今天用create-react-app my-app,看到下面的提示:


A template was not provided. This is likely because you're using an outdated version of create-react-app.

Please note that global installs of create-react-app are no longer supported.  

                                       

根据提示会看到是CRA(create-react-app)是过时的,且不再支持全局安装CRA。

查了些资料可以用npx,用npx有两种方法供参考:

1、你本地全局安装过CRA,如果使用npx create-react-app myApp,它依然用的是本地安装的过时的CRA,如果想使用远程模块,请使用

npx --ignore-existing create-react-app myApp

2、本地安装的CRA已经没有任何使用价值,可先卸载,再使用npx create-react-app myApp即可

  • 卸载全局CRA

npm uninstall -g create-react-app

但是发现卸不掉CRA,因为下面的command还可以拿到它的版本号:

create-react-app -V

->3.0.1

怎么办嘞?那就手动删除吧,执行下面的command:

which create-react-app

->/usr/local/bin/create-react-app

rm -rf /usr/local/bin/create-react-app

create-react-app -V

-bash: /usr/local/bin/create-react-app: No such file or directory

删除成功!

  • 最后用npx就快速生成react项目,运行OK


npx create-react-app myApp

关于create-react-app(react-scripts@3.3.0)升级的坑的更多相关文章

  1. 深入 Create React App 核心概念

    本文差点难产而死.因为总结的过程中,多次怀疑本文是对官方文档的直接翻译和简单诺列:同时官方文档很全面,全范围的介绍无疑加深了写作的心智负担.但在最终的梳理中,发现走出了一条与众不同的路,于是坚持分享出 ...

  2. Create React App

    Facebook开源了React前端框架(MIT Licence),也同时提供了React脚手架 - create-react-app. create-react-app遵循约定优于配置(Coc)的原 ...

  3. 使用create react app教程

    This project was bootstrapped with Create React App. Below you will find some information on how to ...

  4. 如何扩展 Create React App 的 Webpack 配置

    如何扩展 Create React App 的 Webpack 配置  原文地址https://zhaozhiming.github.io/blog/2018/01/08/create-react-a ...

  5. 在 .NET Core 5 中集成 Create React app

    翻译自 Camilo Reyes 2021年2月22日的文章 <Integrate Create React app with .NET Core 5> [1] Camilo Reyes ...

  6. tap news:week5 0.0 create react app

    参考https://blog.csdn.net/qtfying/article/details/78665664 先创建文件夹 安装create react app 这个脚手架(facebook官方提 ...

  7. [React] Create & Deploy a Universal React App using Zeit Next

    In this lesson, we'll use next to create a universal React application with no configuration. We'll ...

  8. Create React App 安装less 报错

    执行npm run eject 暴露模块 安装 npm i  less less-loader -D 1.打开 react app 的 webpack.config.js const sassRege ...

  9. [React] Create and import React components with Markdown using MDXC

    In this lesson I demonstrate how to use the library MDXC to create and import React components with ...

  10. [Parcel] Bundle a React App with Parcel

    Parcel comes in as the new cool kid in the bundlers world. Unlike other bundlers which take lots of ...

随机推荐

  1. OpenCV.学习OpenCV.pdf

    1.Pdf.P160(书.P129) “表5-1:平滑操作的各总类型” 的列名 看起来很模糊,现在先把尽可能看得清的字记录下来: 平滑类型 名称 支持 No 输入数据类型 输出数据类型 简要说明 2. ...

  2. 35.百度云语音识别接口使用及PyAudio语音识别模块安装

    百度云语音识别接口使用: 百度云语音识别接口文档:https://cloud.baidu.com/doc/SPEECH/ASR-API.html#JSON.E6.96.B9.E5.BC.8F.E4.B ...

  3. idea设置方法注释

    1. File-->Settings-->Editor-->Live Templates 1.1 新建Template Group: 命名为 methodNote 1.2 在meth ...

  4. 【AtCoder】ARC070

    ARC070 C - Go Home 题目大意:一只袋鼠第i秒可以向左或向右跳i步或者不跳,问从0跳到x的最小时间 就是1,2,3,4...k总和超过x的最小的k,因为如果超过了x的那部分需要减掉的那 ...

  5. mysql 组合两张表

    select P.FirstName,P.Lastname,A.City,A.State from Person P left join Address A on P.PersonId = A.Per ...

  6. 爬虫-selenium 模块-02

    目录 selenium 模块 chromedriver 浏览器驱动下载与存放 PhantomJS 无界面浏览器 标签元素查找方法 xpath 格式用法 获取标签属性 等待元素被加载 元素交互操作 点击 ...

  7. 什么是Sprint?

    Sprint指Scrum团队完成一定数量工作所需的短暂.固定的周期.Sprint是Scrum和敏捷的核心,找到正确的Sprint周期将帮助您的敏捷团队交付更高质量的产品. “在Scrum框架中,庞大且 ...

  8. oracle_多表查询02

    多表查询 select * from BONUS; select * from DEPT; select * from EMP; select * from SALGRADE; BONUS表 ENAM ...

  9. 沿路径动画(Animation Along a Path)

    Silverlight 提供一个好的动画基础,但缺少一种方便的方法沿任意几何路径对象进行动画处理.在Windows Presentation Foundation中提供了动画处理类DoubleAnim ...

  10. nginx触屏版跟PC的代理设置

    server { listen ; set $mobile_rewrite do_not_perform; if ( $http_user_agent ~* "(android|bb\d+| ...