今天用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. 如何使用 Issue 管理软件项目?

    软件开发(尤其是商业软件)离不开项目管理,Issue 是最通用的管理工具之一.

  2. Mac/Windows 跳过sourcetree的注册环节

      前几天在电脑上装了个sourcetree,结果它硬要我注册,烦得很.   于是查了一下怎么跳过注册环节,结果还真有,试了一下,真给力!   特此记录. MAC版本: 打开sourcetree 关闭 ...

  3. MySQL主从同步报错1507

    mysql 从库上手动删除partiton后,主库未做修改.后期主库上删除partiton后,出现问题. 故障现场 Last_Errno: 1507 Last_Error: Error 'Error ...

  4. oracle建表字段包含关键字注意事项

    SQL建表时最好不要把表定义成关键字字段 1 若不小心把表定义成关键字了,比如option, desc等等,oracle版本查询会有问题,短期内无法修改字段名称的,暂时用字段名+双引号解决: SELE ...

  5. java中讲讲DataInputStream的用法,举例?

    [学习笔记] 2.4 DataInputStream的用法 马 克-to-win:DataInputStream顾名思义:就是专门用来读各种各样的数据的,比如(int,char,long等),一定要注 ...

  6. NIT校赛-- 雷顿女士与平衡树

    题意:https://ac.nowcoder.com/acm/contest/2995/E 给你一棵树,节点有权值,让你求所有路径max-min的和. 思路: 我们计算每个点的贡献,对于一个点,当它为 ...

  7. python学习-6 猜拳小游戏

    import random # 调用随机数模块 pc = random.randint(1,3) # 产生1-3的随机数 print("来玩个猜拳游戏吧!") a = '石头' b ...

  8. Go语言注意事项

    必须恰当导入需要的包,缺少了必要的包或者导入了不需要的包,程序都无法编译通过.这项严格要求避免了程序开发过程中引入未使用的包(译注:Go语言编译过程没有警告信息,争议特性之一 import 声明必须跟 ...

  9. 【KMP】OKR-Periods of Words

    [KMP]OKR-Periods of Words 题目描述 串是有限个小写字符的序列,特别的,一个空序列也可以是一个串.一个串P是串A的前缀,当且仅当存在串B,使得A=PB.如果P≠A并且P不是一个 ...

  10. Linux 系统的安全加固

    Linux是一套免费使用和自由传播的类Unix操作系统,作为一个开放源代码的操作系统,Linux服务器以其安全.高效和稳定的显著优势而得以广泛应用,但如果不做好权限的合理分配,Linux系统的安全性还 ...