无法使用 npx create-react-app@ my-app 创建 React 应用程序

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

我收到以下错误。我更新了 Node 和 npm。我关闭了代理设置。我尝试用 Vite 和 Parcel 创建一个应用程序,但两者都不起作用。

Creating a new React app in D:\MERS\NextJS\youtube.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

npm ERR! code ECONNRESET
npm ERR! network aborted
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in: C:\Users\MANU\AppData\Local\npm-cache\_logs\2024-03-11T00_39_53_976Z-debug-0.log

Aborting installation.
  npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.

Deleting generated file... node_modules
Deleting generated file... package.json
Deleting youtube/ from D:\MERS\NextJS
node:fs:1216
  binding.rmdir(pathModule.toNamespacedPath(path));
          ^

Error: EBUSY: resource busy or locked, rmdir 'D:\MERS\NextJS\youtube'
    at rmdirSync (node:fs:1216:11)
    at _rmdirSync (node:internal/fs/rimraf:235:5)
    at rimrafSync (node:internal/fs/rimraf:193:7)
    at Object.rmSync (node:fs:1265:10)
    at Object.removeSync (C:\Users\MANU\AppData\Local\npm-cache\_npx\9cf80dab71d476d3\node_modules\fs-extra\lib\remove\index.js:15:28)
    at C:\Users\MANU\AppData\Local\npm-cache\_npx\9cf80dab71d476d3\node_modules\create-react-app\createReactApp.js:539:14
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errno: -4082,
  code: 'EBUSY',
  syscall: 'rmdir',
  path: 'D:\\MERS\\NextJS\\youtube'
}

Node.js v21.7.1

See the screenshot

reactjs node.js npm create-react-app npm-install
1个回答
0
投票

从错误消息来看,您的互联网连接速度似乎不快,或者有点故障。 您使用另一个互联网连接重试如何?

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