Npx创建-反应-应用程序提示全局卸载不存在的创建-反应-应用程序包? [英] npx create-react-app prompting to globally uninstall non-existent create-react-app package?

查看:13
本文介绍了Npx创建-反应-应用程序提示全局卸载不存在的创建-反应-应用程序包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了涉及全局安装的npx create-action-app问题。我之所以感到困惑,是因为据我所知,我的计算机上没有安装Create-Reaction-app包。

一些详细信息:

我像以前和最近在同一台计算机上多次所做的那样,启动了一个Reaction项目(使用打字模板):

npx create-react-app --template typescript .

我从终端收到此提示符

Need to install the following packages: create-react-app Ok to proceed? (y)

我按y确认可以继续。(如果我按n,该过程将终止,并显示以下错误:npm ERR! canceled。)然后,终端显示以下消息

You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0).

We no longer support global installation of Create React App.

Please remove any global installs with one of the following commands:
- npm uninstall -g create-react-app
- yarn global remove create-react-app

The latest instructions for creating a new app can be found here:
https://create-react-app.dev/docs/getting-started/
我运行这两个建议的命令来全局卸载create-action-app。 NPM进展顺利:


npm uninstall -g create-react-app

up to date, audited 1 package in 179ms

found 0 vulnerabilities

全局纱线卸载结果显示以下消息:

remove create-react-app
yarn global v1.22.17
warning package.json: No license field
[1/2] 🗑  Removing module create-react-app...
error This module isn't specified in a package.json file.
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.

最后,我尝试查找我的计算机上是否存在Create-Reaction-app which create-react-app 这导致了 create-react-app not found

我不确定还能如何解决此问题。

编辑:Deepthi和Sator提供的解决方案。我必须使用以下命令清除npx缓存,该缓存存储了较旧版本的create-action-app:

npx clear-npx-cache

推荐答案

运行-&npx清除-npx-缓存

 ----> npx create-react-app your-app

这篇关于Npx创建-反应-应用程序提示全局卸载不存在的创建-反应-应用程序包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆