关于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 ...
随机推荐
- react新特性hook
一.hook示例. import React, { useState } from 'react'; function Example() { // 声明一个叫 “count” 的 state 变 ...
- HBase的简单介绍,寻址过程,读写过程
HBase是列族数据库,主要由,表,行键,列族,列标识,值,时间戳 组成, 表 其中HBase 主要底层存储依赖与hdfs,可以在HDFS中看到每个表名都作为一个独立的目录结构 ...
- Docker 安装 Apache
查找Docker Hub上的httpd镜像 apache$ docker search httpd 拉取官方的镜像 docker pull httpd 使用apache镜像 创建目录apache,用于 ...
- MySQL密码正确却无法本地登录,ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
MySQL密码正确却无法本地登录 报错如下: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password ...
- JavaScript(js)笔记
js注释 JavaScript注释与Java注释相同 // 单行注释 /* 多行注释 */ js五大基本类型: number(数值型).string(字符串性).boolean(布尔型).unde ...
- 前端模拟数据接口json-server
今天要找帮前端找一个可以实现数据接口模拟的工具.首先看到的mock.js这个.但是这个需要在页面里插入Mock.js我是要给小程序使用,所以不能这么插入.然后又找到了json-server这个Node ...
- 牛客 26C 手铐 (缩环, 树形dp)
先缩环建树, 对于树上个环$x,y$, 假设$x,y$路径上有$cnt$个环(不包括$x,y$), 贡献就为$2^{cnt}$. 这题卡常挺严重的, 刚开始用并查集合并竟然T了. #include & ...
- docker部署redis
镜像获取 docker pull redis:4.0 ##当前最新版本 docker images 启动 docker run --name redis-huiyuan -p : -v $PWD/da ...
- UPX编译及so加固
UPX编译及so加固 来源 https://www.cnblogs.com/Reverser/p/5778042.html 参考 http://www.cnblogs.com/fishou/p/420 ...
- 使用 SQL的 for xml path来进行字符串拼接
本篇主要讲怎么利用SQL的FOR XML PATH 参数来进行字符串拼接,FOR XML PATH的用法很简单,它会以xml文件的形式来返回数据. 我的讲解步骤: 1:构造初始数据 2:提出问题 3: ...