修复 Create-React-App 的依赖问题

问题描述 投票:0回答:2

我想创建一个反应应用程序,但我收到了一些有关我的依赖项的错误消息。

Installing packages. This might take a couple minutes.    
Installing react, react-dom, and react-scripts...

npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead. 
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.   
npm WARN deprecated [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm WARN deprecated [email protected]: Use your platform's native atob() and btoa() methods instead
npm WARN deprecated [email protected]: Use your platform's native DOMException instead
npm WARN deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead
npm WARN deprecated [email protected]: Use your platform's native performance.now() and performance.timeOrigin.     
npm WARN deprecated [email protected]: [email protected]
npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.

added 1462 packages, and audited 1463 packages in 3m      

242 packages are looking for funding
  run `npm fund` for details

8 vulnerabilities (2 moderate, 6 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

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.
You can fix this by running npm uninstall -g create-react-app or yarn global remove create-react-app before using create-react-app again.

我尝试通过运行来修复它

npm uninstall -g create-react-app

我的文件夹结构只有我的node_modules、package.json和package.lock.json。没有 src 和 public 文件夹。

reactjs node.js dependencies babeljs create-react-app
2个回答
0
投票

create-react-app 已弃用,请使用类似 Vite 的内容。

再见create-react-app


0
投票

在终端上运行npm或yarn命令。

npm 7+,需要额外的双破折号:

npm create vite@latest my-react-app -- --template react

纱线

yarn create vite my-react-app --template react

文档:https://vitejs.dev/guide/

© www.soinside.com 2019 - 2024. All rights reserved.