Lend Sham
Lend Sham

Reputation: 63

Error while install package react-typed and others

$ npm install react-typed
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.3.0" from [email protected]
npm ERR! node_modules/react-typed
npm ERR!   react-typed@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\nusha\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\nusha\AppData\Local\npm-cache\_logs\2021-01-23T17_43_17_669Z-debug.log
$ npm install react-typed --legacy-peer-deps
npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path D:\Fullstack Cilsy\Code\create-react\portfolio-project1\node_modules\jquery
npm ERR! dest D:\Fullstack Cilsy\Code\create-react\portfolio-project1\node_modules\.jquery-nnI3d113
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'D:\Fullstack Cilsy\Code\create-react\portfolio-project1\node_modules\jquery' -> 'D:\Fullstack Cilsy\Code\create-react\portfolio-project1\node_modules\.jquery-nnI3d113'
npm ERR!  [Error: EPERM: operation not permitted, rename 'D:\Fullstack Cilsy\Code\create-react\portfolio-project1\node_modules\jquery' -> 'D:\Fullstack Cilsy\Code\create-react\portfolio-project1\node_modules\.jquery-nnI3d113'] {
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'rename',
npm ERR!   path: 'D:\\Fullstack Cilsy\\Code\\create-react\\portfolio-project1\\node_modules\\jquery',
npm ERR!   dest: 'D:\\Fullstack Cilsy\\Code\\create-react\\portfolio-project1\\node_modules\\.jquery-nnI3d113'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\nusha\AppData\Local\npm-cache\_logs\2021-01-23T16_35_50_683Z-debug.log

Upvotes: 1

Views: 9033

Answers (5)

Eugene Kordunianu
Eugene Kordunianu

Reputation: 1

The error you're seeing is related to a dependency conflict in your project. In your project, you have installed React version 18.2.0, but the package react-typed requires React "^16.3.0".

Check if you really need react-typed version 1.2.0, which requires React "^16.3.0". There might be newer versions of react-typed that are compatible with React 18. If there are no such versions, you may consider finding an alternative package that supports React 18.

If you can't find an alternative, try changing the React version in your project to the version required by react-typed (i.e., "^16.3.0"). You can do this by modifying the React version in your package.json file and then running npm install again.

Upvotes: 0

Muhammad Ahmad Ali
Muhammad Ahmad Ali

Reputation: 1

  1. Delete node_modules Folder.
  2. Delete Package-lock.json File.
  3. Run npm install --legacy-peer-deps

This should solve the problem.

Upvotes: 0

Nweke Maxwell
Nweke Maxwell

Reputation: 11

I solved mine with

npm install typed.js

Upvotes: 0

John Ndigirigi
John Ndigirigi

Reputation: 51

Solve it by using the command

npm install react-typed --force 

instead of just

npm install react-typed

It will work fine.

Upvotes: 4

Lend Sham
Lend Sham

Reputation: 63

Solved

After I delete folder node_modules and file package-lock.json in my react project. I tried to "npm install" and add --legacy-peer-deps "npm install react-typed --legacy-peer-deps"

I don't know why before delete node_module and package-lock.json I can't run with --legacy-peer-deps

Upvotes: 4

Related Questions