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-authmy-app'
at Object.mkdirSync (node:fs:1380:26)
at module.exports.makeDirSync (C:UsersuserAppDataLocalnpm-cache_npxc67e74de0542c87cnode_modulesfs-extralibmkdirsmake-dir.js:23:13)
at createApp (C:UsersuserAppDataLocalnpm-cache_npxc67e74de0542c87cnode_modulescreate-react-appcreateReactApp.js:257:6)
at C:UsersuserAppDataLocalnpm-cache_npxc67e74de0542c87cnode_modulescreate-react-appcreateReactApp.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
2
Answers
According to the latest official React documentation, there are two methods to install React.js: using a framework (such as Next.js, Remix, or Gatsby) or without a framework (using Vite or Parcel).
To start a new React project with Vite, you can use the following command:
For more information, you can refer to the Vite documentation: https://vitejs.dev/guide/
This command will prompt the installation process for Vite, allowing you to set up and begin your React project easily.
The error says it all:
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.