关于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 ...
随机推荐
- java_guide_类加载器
类加载器总结 JVM 中内置了三个重要的 ClassLoader,除了 BootstrapClassLoader 其他类加载器均由 Java 实现且全部继承自java.lang.ClassLoader ...
- .net 结合FFMPEG
读取流 https://blog.csdn.net/vanjoge/article/details/79657874 基于设备,推流 https://blog.csdn.net/lxbwolf/art ...
- PTA(Advanced Level)1037.Magic Coupon
The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, m ...
- [转]mac升级Nodejs和Npm到最新版
第一步,先查看本机node.js版本: node -v 第二步,清除node.js的cache: sudo npm cache clean -f 第三步,安装 n 工具,这个工具是专门用来管理node ...
- 在win7中解决Visual C++ 6.0打开文件时出现停止工作问题
在使用Visual C++ 6.0打开文件时可能会出现下面的情况 这可能是Vc6.0和win7兼容性问题. 方法: 下载filetool即可 链接:https://pan.baidu.com/s/1X ...
- Windows应急响应常见命令
---恢复内容开始--- 1.查看所有连接的PID netstat -ano 2.过滤特定端口 netstat -ano | findstr “443” 3.查看占用443端口的进程 tasklist ...
- JSON运用在文件
#include <iostream>#include <fstream>#define JSON_IS_AMALGAMATION#include "json/jso ...
- C# 使用Emit实现动态AOP框架 (三)
目 录 C# 使用Emit实现动态AOP框架 (一) C# 使用Emit实现动态AOP框架 (二) C# 使用Emit实现动态AOP框架 (三) C# 使用Emit实现动态AOP框架 进阶篇之异常处 ...
- 深入理解Java自动装箱拆箱机制
1.自动装箱与拆箱的定义 装箱就是自动将基本数据类型转换为包装器类型(int-->Integer): 拆箱就是自动将包装器类型转换为基本数据类型(Integer-->int). Java中 ...
- LeetCode 腾讯精选50题--二叉树的最大深度
求二叉树的最大深度, 基本思路如下: 设定一个全局变量记录二叉树的深度,利用递归,没遍历一层都将临时深度变量+1,并在每一节点递归结束后判断深度大小. 具体代码如下: package algorith ...