【问题标题】:i am getting an error when creating a react app using npx使用 npx 创建 React 应用程序时出现错误
【发布时间】:2021-12-31 19:57:39
【问题描述】:
npx create-react-app my-app

错误: 我们不再支持全局安装 Create React App。 请使用以下命令之一删除任何全局安装: - npm 卸载 -g create-react-app - yarn global 移除 create-react-app

我试过了

 npm uninstall -g create-react-app

然后

 npx create-react-app my-app 

但它仍然给我同样的错误 节点--版本 v14.17.6 npm --version 8.1.1

【问题讨论】:

  • 尝试运行它可能会修复 $ npm cache verify $ npm clean cache --force

标签: reactjs


【解决方案1】:

试试这个,我遇到了同样的问题并修复了它清理缓存,然后运行 ​​npx create-react-app my-app

npm cache clean --force
npx create-react-app myapp

如需进一步指导,请查看之前的答案

I can't install react using npx create-react-app?

您也可以查看官方文档。

https://reactjs.org/docs/create-a-new-react-app.html#create-react-app

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-01-21
    • 1970-01-01
    • 2021-11-27
    • 2020-12-14
    • 1970-01-01
    • 1970-01-01
    • 2021-07-22
    • 2021-08-16
    相关资源
    最近更新 更多