Search code examples
javascriptreactjsnode.jstypescriptnpm

When I create a react app I get an error: node:fs:1380 const result = binding.mkdir(


By entering the command:

create-react-app my-app --template typescript

Then an error appears:

node:fs:1380
  const result = binding.mkdir(
                         ^

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

Node.js v20.11.0

Please help me. I tried all the methods and nothing helped


Solution

  • The error says it all:

    operation not permitted, mkdir 'D:\jwt-auth\my-app'

    The user you are running the command with does not have the necessary permissions to create a directory at the path specified. Either run it with an administrator, or a user who has the necessary privileges or grant the user you are about to run this command the necessary privileges.