0
votes

I am getting this error whenever I run npx-create-react-app ./

node:internal/modules/cjs/loader:927 throw err; ^

Error: Cannot find module 'C:\Users\Siddhant Mishra\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15) at Function.Module._load (node:internal/modules/cjs/loader:769:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts...

node:internal/modules/cjs/loader:927 throw err; ^

Error: Cannot find module 'C:\Users\Siddhant Mishra\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15) at Function.Module._load (node:internal/modules/cjs/loader:769:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }

Aborting installation. npm install --save --save-exact --loglevel error react react-dom [email protected] has failed.

Deleting generated file... package.json Deleting sid/ from D:\work\courses node:fs:928 return handleErrorFromBinding(ctx); ^

Error: EBUSY: resource busy or locked, rmdir 'D:\work\courses\sid'
at Object.rmdirSync (node:fs:928:10) at rmdirSync (C:\Users\Siddhant Mishra\AppData\Roaming\npm\node_modules\create-react-app\node_modules\fs-extra\lib\remove\rimraf.js:264:13) at Object.rimrafSync [as removeSync] (C:\Users\Siddhant Mishra\AppData\Roaming\npm\node_modules\create-react-app\node_modules\fs-extra\lib\remove\rimraf.js:243:7) at C:\Users\Siddhant Mishra\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:567:14 at processTicksAndRejections (node:internal/process/task_queues:94:5) { errno: -4082, syscall: 'rmdir', code: 'EBUSY', path: 'D:\work\courses\sid' }

2

2 Answers

0
votes

You could try npx create-react-app my-app(or whatever name you want to call your app)

0
votes

try this if it is not alloowing to create react app "npm i create-react-app" or Try to uninstall all node modules and try again with npx command