今天用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. ffmpeg学习笔记-音频播放

    前文讲到音频解码,将音频解码,并且输入到PCM文件,这里将音频通过AudioTrack直接输出 音频播放说明 在Android中自带的MediaPlayer也可以对音频播放,但其支持格式太少 使用ff ...

  2. springBoot--组合注解RestController,GetMapping,PostMapping

    一.RestController @RestController 是@Controller和@ResponseBody的缩写 二.@getMapping和PostMapping @GetMapping ...

  3. cent7虚拟机切换root时出现"ABRT has detected ..."问题

      今早打开虚拟机,在sudo -i的时候,发现出了这个问题: 于是我按照提示,执行abrt-cli list --since 1563382095后,结果如下: 大意就是内核出现了某CPU软死锁的问 ...

  4. [转帖CCIX]

    业界七巨头联手,数据中心通过PCIe实现25Gbps数据通信! 2017-06-07 17:31 CCIX(Cache Coherent Interconnect for Accelerators,针 ...

  5. A<=B的前提下全排列A使答案尽量大

    题意:http://codeforces.com/problemset/problem/915/C 举个例子:假使排好序后a字符串是123456,b是456456,按照上述方法遍历,213456 -& ...

  6. python-----模块【第一部分】-----

    一.hashlib(md5) import hashlib obj = hashlib.md5('dsfd'.encode('utf-8')) obj.update('123'.encode('utf ...

  7. python--基本语法与变量

    python基本语法与变量 python语句的缩进 Python代码块使用缩进对齐表示代码逻辑,Python每段代码块缩进的空白数量可以任意,但要确保同段代码块语句必须包含相同的缩进空白数量.建议在代 ...

  8. java项目上线的流程(将web项目部署到公网)

    本博文来源于网络,原文的地址在本篇博文最下方. 如何将java web项目上线/部署到公网 关于如何将Java Web上线,部署到公网,让全世界的人都可以访问的问题.小编将作出系列化,完整的流程介绍. ...

  9. javascript数字格式化通用类——accounting.js使用

    简介 accounting.js 是一个非常小的JavaScript方法库用于对数字,金额和货币进行格式化.并提供可选的Excel风格列渲染.它没有依赖任何JS框架.货币符号等可以按需求进行定制. 代 ...

  10. FLEX AIR 读写安卓本地文件

    1.  目标: 将字节流图片保存在安卓本地路径,如 "/data/mypppd/"下, file = File.documentsDirectory.resolvePath(&qu ...