简体   繁体   中英

Facing problem during installing react project and setting up of Node Js

I am trying to setup a ReactJS app on Windows using the following command in Git Bash:

npx create-react-app my-app

and the output is coming as:

`Creating a new React app in C:\Users\Dell\desktop\react-portfolio-website-1.

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

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

Deleting generated file... package.json Deleting react-portfolio-website-1/ from C:\Users\Dell\desktop node:fs:1226 return handleErrorFromBinding(ctx); ^

Error: EBUSY: resource busy or locked, rmdir '\?\C:\Users\Dell\desktop\react-portfolio-website-1' at rmdirSync (node:fs:1226:10) at _rmdirSync (node:internal/fs/rimraf:235:5) at rimrafSync (node:internal/fs/rimraf:193:7) at Object.rmSync (node:fs:1275:10) at Object.removeSync (C:\Users\Dell\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\fs-extra\lib\remove\index.js:15:28) at C:\Users\Dell\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:539:14 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { errno: -4082, syscall: 'rmdir', code: 'EBUSY', path: '\\?\C:\Users\Dell\desktop\react-portfolio-website-1' }

Node.js v18.12.1 `

I always face this problem, expected to get new react js project.

I had almost same issue, I had to changed my terminal for VSCode from Powershell to bash, then I ran these commands and it worked.

npm cache clean --force

npx create-react-app (project name)

Hope this should help you

Are you on VPN or do you have any antivirus installed. Try disabling it and then running npx create---

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM