关于create-react-app(react-scripts@3.3.0)升级的坑
今天用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)升级的坑的更多相关文章
- 深入 Create React App 核心概念
本文差点难产而死.因为总结的过程中,多次怀疑本文是对官方文档的直接翻译和简单诺列:同时官方文档很全面,全范围的介绍无疑加深了写作的心智负担.但在最终的梳理中,发现走出了一条与众不同的路,于是坚持分享出 ...
- Create React App
Facebook开源了React前端框架(MIT Licence),也同时提供了React脚手架 - create-react-app. create-react-app遵循约定优于配置(Coc)的原 ...
- 使用create react app教程
This project was bootstrapped with Create React App. Below you will find some information on how to ...
- 如何扩展 Create React App 的 Webpack 配置
如何扩展 Create React App 的 Webpack 配置 原文地址https://zhaozhiming.github.io/blog/2018/01/08/create-react-a ...
- 在 .NET Core 5 中集成 Create React app
翻译自 Camilo Reyes 2021年2月22日的文章 <Integrate Create React app with .NET Core 5> [1] Camilo Reyes ...
- tap news:week5 0.0 create react app
参考https://blog.csdn.net/qtfying/article/details/78665664 先创建文件夹 安装create react app 这个脚手架(facebook官方提 ...
- [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 ...
- Create React App 安装less 报错
执行npm run eject 暴露模块 安装 npm i less less-loader -D 1.打开 react app 的 webpack.config.js const sassRege ...
- [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 ...
- [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 ...
随机推荐
- spring中@Conditional注解
@Conditional是Spring4新提供的注解,它的作用是根据某个条件加载特定的bean. 我们需要创建实现类来实现Condition接口,这是Condition的源码 public inter ...
- java 面试题汇总
一.Java 基础 1.JDK 和 JRE 有什么区别? JDK是java开发工具包,提供java的开发环境和运行环境.包括编译器.开发工具和更多的类库等.JDK包含了JRE. JRE是java运行环 ...
- Qt中QGraphics类坐标映射关系详解
1.Item(图元)坐标:属于局部坐标,通常以图元中心为原点(中心对称),非中心对称类,比如dialog类,一般以左上角为原点,正方向x朝右,y朝下. 2.setPos的坐标是父类坐标系的坐标,一般对 ...
- celery异步任务
1.安装 pip install celery 2.创建celery_tasks文件夹,创建config配置文件和main文件 # 在config.py文件中配置中间人broker地址信息 - red ...
- pycharm 关联 maya
设置pycharm代码自动补全 + pycharm关联maya 一.pycharm 设置 python环境,设置代码自动补全 1.devkit 选择对应版本进行下载https://www.autode ...
- 学习BM算法
BM算法: 希望大家别见怪,当前博客只用于个人记录所用. [例题]Poor God Water 题意: 有肉,鱼,巧克力三种食物,有几种禁忌,对于连续的三个食物, 1.这三个食物不能都相同: 2.若三 ...
- vue插件总结——总有你能用上的插件
UI组件 框架 element - 饿了么出品的Vue2的web UI工具套件 mint-ui - Vue 2的移动UI元素 iview - 基于 Vuejs 的开源 UI 组件库 Keen-UI - ...
- 牛客 26C 手铐 (缩环, 树形dp)
先缩环建树, 对于树上个环$x,y$, 假设$x,y$路径上有$cnt$个环(不包括$x,y$), 贡献就为$2^{cnt}$. 这题卡常挺严重的, 刚开始用并查集合并竟然T了. #include & ...
- 优化方法总结以及Adam存在的问题(SGD, Momentum, AdaDelta, Adam, AdamW,LazyAdam)
优化方法总结以及Adam存在的问题(SGD, Momentum, AdaDelta, Adam, AdamW,LazyAdam) 2019年05月29日 01:07:50 糖葫芦君 阅读数 455更多 ...
- Spring实战(三)Spring中装配Bean的三种方式---XML、JavaConfig、AutoWire
创建应用对象之间协作关系的行为称为装配(wiring),这也是依赖注入的本质. Spring容器负责创建应用程序中的bean并通过DI来协调这些对象之间的关系,而开发者需要告诉Spring需要创建哪些 ...