Bahriddin
Bahriddin

Reputation: 324

How can I install React using NPM?

I can't install react using npm for some reason, I can't figure out what the problem is. Does anyone know a solution to this problem? I uninstalled npm and tried again but it didn't help and tried other things. but it doesn't help me.

stalling react, react-dom, and react-scripts with cra-template...

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\darslar\imtihon-app\node_modules\tailwindcss\oxide-node-api-shim/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\darslar\imtihon-app\node_modules\tailwindcss\oxide-node-api-shim\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Local\npm-cache\_logs\2023-02-08T15_57_28_764Z-debug-0.log

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
node:fs:1226
  return handleErrorFromBinding(ctx);
         ^

Error: EBUSY: resource busy or locked, rmdir '\\?\D:\darslar\imtihon-app'
    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\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',
}

Node.js v18.12.0

Upvotes: 0

Views: 2471

Answers (2)

Artist149
Artist149

Reputation: 1

https://github.com/tailwindlabs/tailwindcss/issues/10534#issuecomment-1422896616

Basically you need update npm to latest version

npm install -g npm@latest

Delete package-lock.json and node_modules and launch

npm i

It was a problem with dependency of cra. Whole world couldn`t install react for one hour.

Upvotes: 0

SamuelMR
SamuelMR

Reputation: 100

Try these steps:

  • Delete package-lock.json and run NPM again.

  • Ensure no other processes of node.js are running (check task manager)

  • If you are using visual studio code, close it and try running npm install again.

You can also check the following issue page: https://github.com/npm/npm/issues/17444

Upvotes: 1

Related Questions