【发布时间】:2022-01-21 08:46:51
【问题描述】:
C:\Users\lg\Desktop> npm uninstall -g create-react-app
up to date, audited 1 package in 216ms
found 0 vulnerabilities
C:\Users\lg\Desktop>npx clear-npx-cache
Need to install the following packages:
clear-npx-cache
Ok to proceed? (y) y
C:\Users\lg\Desktop>npx create-react-app@5.0.0 reduxapp
Need to install the following packages:
create-react-app@5.0.0
Ok to proceed? (y) y
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
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/
C:\Users\lg\Desktop>npm i tar
up to date, audited 153 packages in 1s
6 packages are looking for funding
run `npm fund` for details
3 high severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
C:\Users\lg\Desktop>npx create-react-app@5.0.0 reduxapp
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/
我尝试通过谷歌搜索解决,但似乎出现错误,无法创建文件夹。
【问题讨论】:
-
按照文档的建议,使用
npx create-react-app my-app -
我试过了,“你正在运行
create-react-app4.0.3,它落后于最新版本(5.0.0)。我们不再支持全局安装 Create React App。”同样的警告。 -
确保您使用的是
npx而不是npm -
哪一部分?我想我正在使用 npx。