facebook / create-react-app

Set up a modern web app by running one command.
https://create-react-app.dev
MIT License
102.69k stars 26.84k forks source link

node:fs:1334 handleErrorFromBinding(ctx); #11605

Closed JoseanMeonez closed 11 months ago

JoseanMeonez commented 2 years ago

Hello everyone, I got an error when I'm creating my npx create-react-app my-app, I've been tried using the globally way with npm install -g create-react-app my-app but isn't work too I hope you help me with this, the error is:

`node:fs:1334
  handleErrorFromBinding(ctx);
  ^

Error: EPERM: operation not permitted, mkdir 'D:\my-app'
    at Object.mkdirSync (node:fs:1334:3)
    at Object.module.exports.makeDirSync (C:\Users\Jose Andres\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\fs-extra\lib\mkdirs\make-dir.js:101:15)
    at createApp (C:\Users\Jose Andres\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:255:6)
    at C:\Users\Jose Andres\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:226:9
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  errno: -4048,
  syscall: 'mkdir',
  code: 'EPERM',
  path: 'D:\\my-app'
}

Node.js v17.0.1`
spaipalle commented 2 years ago

try running npx create-react-app my-app in /home/user/{xxxxxxxxxxxxxxx}/new-folder/

  1. Navigate to /home/user/{xxxxx} folder
  2. Create a new directory
  3. Navigate to new directory
  4. Run npx create-react-app my-app
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

Olu-martins commented 2 years ago

@spaipalle Your solution worked...thanks in bunch

Olu-martins commented 2 years ago

@spaipalle But may asked why i can't create on my desktop?...i am new into react

AyushiG19 commented 2 years ago

I am also getting the same error but still cant resolve plz help ! react_problem

.

venkatram08 commented 2 years ago

@AyushiG19

Solution 1: Uninstall npm ["npm uninstall -g create-react-app"] then try to create app [Perform this in E drive as per your image)

If Solution 1 do not work try Solution 2

Solution 2: Try to create react app in different drive (D or C) it will definitely work

mostlovedpotato commented 2 years ago
$ npx create-react-app .

Creating a new React app in H:\Projects\game-web.

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 game-web/ from H:\Projects
node:fs:1225
  return handleErrorFromBinding(ctx);
         ^

Error: EBUSY: resource busy or locked, rmdir '\\?\H:\Projects\game-web'
    at rmdirSync (node:fs:1225:10)
    at _rmdirSync (node:internal/fs/rimraf:235:5)
    at rimrafSync (node:internal/fs/rimraf:193:7)
    at Object.rmSync (node:fs:1274:10)
    at Object.removeSync (C:\Users\User\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\fs-extra\lib\remove\index.js:15:28)
    at C:\Users\User\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: '\\\\?\\H:\\Projects\\game-web'
}

Node.js v18.4.0

I am getting similar error , but not the same. Why is it that I have to switch the whole H: drive ain't there any better solution?

Pritam-hub-13 commented 2 years ago

@AyushiG19

Solution 1: Uninstall npm ["npm uninstall -g create-react-app"] then try to create app [Perform this in E drive as per your image)

If Solution 1 do not work try Solution 2

Solution 2: Try to create react app in different drive (D or C) it will definitely work

solution 2 is worked

venkatram08 commented 2 years ago
$ npx create-react-app .

Creating a new React app in H:\Projects\game-web.

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 game-web/ from H:\Projects
node:fs:1225
  return handleErrorFromBinding(ctx);
         ^

Error: EBUSY: resource busy or locked, rmdir '\\?\H:\Projects\game-web'
    at rmdirSync (node:fs:1225:10)
    at _rmdirSync (node:internal/fs/rimraf:235:5)
    at rimrafSync (node:internal/fs/rimraf:193:7)
    at Object.rmSync (node:fs:1274:10)
    at Object.removeSync (C:\Users\User\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\fs-extra\lib\remove\index.js:15:28)
    at C:\Users\User\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: '\\\\?\\H:\\Projects\\game-web'
}

Node.js v18.4.0

I am getting similar error , but not the same. Why is it that I have to switch the whole H: drive ain't there any better solution?

SOLUTION::

1) This might occur due to anti malware software that was installed on your PC, once disable it and try to create it again! (or) if you have Dropbox disable it. 2) Try by running the same command with "Run as Administrator" in command prompt. 3) OR TRY RUNNING npm cache clean

ahmmaadd17 commented 1 year ago

mac@MACs-MacBook-Air hashlips_art_engine-1.1.2_patch_v6 2 % npm run generate

hashlips_art_engine@1.1.1 generate node index.js

(node:70620) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead (Use node --trace-deprecation ... to show where the warning was created) node:fs:1451 handleErrorFromBinding(ctx); ^

Error: ENOENT: no such file or directory, scandir '/Users/mac/Downloads/hashlips_art_engine-1.1.2_patch_v6 2/layers/backgorund/' at Object.readdirSync (node:fs:1451:3) at getElements (/Users/mac/Downloads/hashlips_art_engine-1.1.2_patch_v6 2/src/main.js:73:6) at /Users/mac/Downloads/hashlips_art_engine-1.1.2_patch_v6 2/src/main.js:92:15 at Array.map () at layersSetup (/Users/mac/Downloads/hashlips_art_engine-1.1.2_patch_v6 2/src/main.js:90:30) at startCreating (/Users/mac/Downloads/hashlips_art_engine-1.1.2_patch_v6 2/src/main.js:356:20) at /Users/mac/Downloads/hashlips_art_engine-1.1.2_patch_v6 2/index.js:6:3 at Object. (/Users/mac/Downloads/hashlips_art_engine-1.1.2_patch_v6 2/index.js:7:3) at Module._compile (node:internal/modules/cjs/loader:1159:14) at Module._extensions..js (node:internal/modules/cjs/loader:1213:10) { errno: -2, syscall: 'scandir', code: 'ENOENT', path: '/Users/mac/Downloads/hashlips_art_engine-1.1.2_patch_v6 2/layers/backgorund/' }

Node.js v18.12.1 can somebody help me in this phase?

zhraa05 commented 1 year ago

Hello everyone, I got an error when I'm creating my npx create-react-app my-app, I've been tried using the globally way with npm install -g create-react-app my-app and Uninstall npm ["npm uninstall -g create-react-app"] then try to create app [Perform this in E drive as per your image) and create react app in different drive (D or C) but isn't work too I hope you help me with this, the error is: `node:fs:1334 handleErrorFromBinding(ctx); ^

Error: EPERM: operation not permitted, mkdir 'D:\my-app' at Object.mkdirSync (node:fs:1334:3) at Object.module.exports.makeDirSync (C:\Users\Jose Andres\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\fs-extra\lib\mkdirs\make-dir.js:101:15) at createApp (C:\Users\Jose Andres\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:255:6) at C:\Users\Jose Andres\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:226:9 at processTicksAndRejections (node:internal/process/task_queues:96:5) { errno: -4048, syscall: 'mkdir', code: 'EPERM', path: 'D:\my-app' }

Node.js v18.16.0

madhaninfo95 commented 1 year ago

Hello everyone, I got an error when I'm creating my npx create-react-app my-app

PS D:\React> npx create-react-app my-app node:fs:1398 handleErrorFromBinding(ctx); ^

Error: EPERM: operation not permitted, mkdir 'my-app' at Object.mkdirSync (node:fs:1398:3) at module.exports.makeDirSync (C:\Users\63\AppData\Roaming\npm\node_modules\create-react-app\node_modules\fs-extra\lib\mkdirs\make-dir.js:23:13) at createApp (C:\Users\63\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:257:6) at C:\Users\63\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:223:9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { errno: -4048, syscall: 'mkdir', code: 'EPERM', path: 'my-app' }

jreyes73 commented 10 months ago

try running npx create-react-app my-app in /home/user/{xxxxxxxxxxxxxxx}/new-folder/

  1. Navigate to /home/user/{xxxxx} folder
  2. Create a new directory
  3. Navigate to new directory
  4. Run npx create-react-app my-app

This worked for me! thanks @spaipalle

pratham5368 commented 10 months ago
                                   npx shadcn-ui@latest init

node:fs:603 handleErrorFromBinding(ctx); ^

Error: package.json: ENOENT: no such file or directory, open 'package.json' at Object.openSync (node:fs:603:3) at Object.readFileSync (node:fs:471:35) at Object.readFileSync (C:\Users\prath\AppData\Local\npm-cache_npx\125ee17d583c4e03\node_modules\jsonfile\index.js:50:22) at Te (file:///C:/Users/prath/AppData/Local/npm-cache/_npx/125ee17d583c4e03/node_modules/shadcn-ui/dist/index.js:124:3741) at xt (file:///C:/Users/prath/AppData/Local/npm-cache/_npx/125ee17d583c4e03/node_modules/shadcn-ui/dist/index.js:124:3872) at file:///C:/Users/prath/AppData/Local/npm-cache/_npx/125ee17d583c4e03/node_modules/shadcn-ui/dist/index.js:124:4099 at ModuleJob.run (node:internal/modules/esm/module_job:194:25) { errno: -4058, syscall: 'open', code: 'ENOENT', path: 'package.json' }