Fail to install redux npm package! -4048 - reactjs

I’m trying to install npm package (npm install redux) but its fail to install.
How can i solve this problem ?
this is the error:
npm WARN #babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining#7.16.0 requires a peer of #babel/core#^7.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils#3.21.0 requires a peer of typescript#>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path C:\webDevelopment\MERN-blog\client\node_modules.node-sass.DELETE\vendor\win32-x64-83\binding.node
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\webDevelopment\MERN-blog\client\node_modules.node-sass.DELETE\vendor\win32-x64-83\binding.node'
npm ERR! [OperationalError: EPERM: operation not permitted, unlink 'C:\webDevelopment\MERN-blog\client\node_modules.node-sass.DELETE\vendor\win32-x64-83\binding.node'] {
npm ERR! cause: [Error: EPERM: operation not permitted, unlink 'C:\webDevelopment\MERN-blog\client\node_modules.node-sass.DELETE\vendor\win32-x64-83\binding.node'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'C:\webDevelopment\MERN-blog\client\node_modules\.node-sass.DELETE\vendor\win32-x64-83\binding.node'
npm ERR! },
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'C:\webDevelopment\MERN-blog\client\node_modules\.node-sass.DELETE\vendor\win32-x64-83\binding.node',
npm ERR! parent: 'client'
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\Power\AppData\Roaming\npm-cache_logs\2021-11-30T05_06_38_588Z-debug.log

Test this way
1- first delete node_module folder
2- npm install or yarn
3- npm i redux or yarn add redux

Can you delete the exiting node module from the project
once done reinstall the node module package
using npm
npm install redux
using yarn
yarn add redux
for reference
https://redux.js.org/introduction/installation

Related

React is not running

npm WARN config global --global, --local are deprecated. Use --location=global instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-barcode#1.4.1
npm ERR! Found: react#18.2.0
npm ERR! node_modules/react
npm ERR! react#"^18.2.0" from the root project
npm ERR! peer react#">=16.8.4" from #ant-design/charts#1.4.2
npm ERR! node_modules/#ant-design/charts
npm ERR! #ant-design/charts#"^1.4.2" from the root project
npm ERR! 65 more (#ant-design/flowchart, #ant-design/graphs, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.0.0 || ^17.0.0" from react-barcode#1.4.1
npm ERR! node_modules/react-barcode
npm ERR! react-barcode#"^1.4.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#17.0.2
npm ERR! node_modules/react
npm ERR! peer react#"^16.0.0 || ^17.0.0" from react-barcode#1.4.1
npm ERR! node_modules/react-barcode
npm ERR! react-barcode#"^1.4.1" 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!
npm ERR! For a full report see:
npm ERR! C:\Users\ghost\AppData\Local\npm-cache_logs\2023-01-24T07_50_41_550Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ghost\AppData\Local\npm-cache_logs\2023-01-24T07_50_41_550Z-debug-0.log
I tried npm install and this error is showing.
I also used npm start But it also showed error
npm WARN config global --global, --localare deprecated. Use--location=global` instead.
frontend#0.1.0 start
react-scripts start
'react-scripts' is not recognized as an internal or external command,
operable program or batch file.`
This is due to the version of react-scripts did not match your project.
Run npm install react-scripts --save
Your project should be running fine

How to do (npm install --force) in next build?

I'm trying to build a next project that some of its dependencies are not compatible apparently. The below errors show up:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: eslint-plugin-react-hooks#2.5.1
npm ERR! Found: eslint#7.31.0
npm ERR! node_modules/eslint
dev eslint#"^7.12.1" from the root project
npm ERR! peer eslint#"^5.0.0 || ^6.0.0 || ^7.0.0" from #typescript-eslint/eslint-plugin#4.28.5
npm ERR! node_modules/#typescript-eslint/eslint-plugin
npm ERR! dev #typescript-eslint/eslint-plugin#"^4.0.0" from the root project
npm ERR! peer #typescript-eslint/eslint-plugin#"^4.4.1" from eslint-config-airbnb-typescript#12.0.0
npm ERR! node_modules/eslint-config-airbnb-typescript
npm ERR! dev eslint-config-airbnb-typescript#"12.0.0" from the root project
npm ERR! 9 more (#typescript-eslint/experimental-utils, ...)
npm ERR!
Could not resolve dependency:
npm ERR! peer eslint#"^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" from eslint-plugin-react-hooks#2.5.1
npm ERR! node_modules/eslint-plugin-react-hooks
npm ERR! dev eslint-plugin-react-hooks#"^2.3.0" from the root project
npm ERR! peer eslint-plugin-react-hooks#"^4 || ^3 || ^2.3.0 || ^1.7.0" from eslint-config-airbnb#18.2.0
npm ERR! node_modules/eslint-config-airbnb
npm ERR! eslint-config-airbnb#"18.2.0" from eslint-config-airbnb-typescript#12.0.0
npm ERR! node_modules/eslint-config-airbnb-typescript
ERR! dev eslint-config-airbnb-typescript#"12.0.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: eslint#6.8.0
npm ERR! node_modules/eslint
npm ERR! peer eslint#"^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" from eslint-plugin-react-hooks#2.5.1
npm ERR! node_modules/eslint-plugin-react-hooks
npm ERR! dev eslint-plugin-react-hooks#"^2.3.0" from the root project
npm ERR! peer eslint-plugin-react-hooks#"^4 || ^3 || ^2.3.0 || ^1.7.0" from eslint-config-airbnb#18.2.0
node_modules/eslint-config-airbnb
npm ERR! eslint-config-airbnb#"18.2.0" from eslint-config-airbnb-typescript#12.0.0
npm ERR! node_modules/eslint-config-airbnb-typescript
npm ERR! dev eslint-config-airbnb-typescript#"12.0.0" 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
to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /root/.npm/eresolve-report.txt for a full report.
I want to ignore these errors and go on with the possibly broken dependencies (as in npm install --force) but I'm not sure how I can to this with next build. (I've tried next build --force and it doesn't work.)

getting error in while installing react-lottie in react18

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: mytestonmac#0.1.0
npm ERR! Found: react#18.1.0
npm ERR! node_modules/react
npm ERR! react#"^18.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^0.14.7 || ^15.0.0 || ^16.0.0" from react-lottie#1.2.3
npm ERR! node_modules/react-lottie
npm ERR! react-lottie#"*" 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 /Users/apple/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/apple/.npm/_logs/2022-05-10T10_42_29_299Z-debug-0.log
npm i react-lottie -force
You can use -force to install library doesn't support latest ReactJS yet
--force works, but might have some unexpected consequences. I added an override for now for it in my package.json:
"overrides":{
"react-lottie": {
"react": "^0.14.7 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
}
},

react suite (rsuite) package installation is failing

When I tried to install rsuite (version 4.9.3) package using the command,
npm i rsuite
I am getting this error. Can anyone help me with this installation process?
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react#17.0.1
npm ERR! node_modules/react
npm ERR! peer react#"*" from #testing-library/react#11.2.5
npm ERR! node_modules/#testing-library/react
npm ERR! #testing-library/react#"^11.2.5" from the root project
npm ERR! peer react#"^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" from mini-create-react-context#0.4.1
npm ERR! node_modules/mini-create-react-context
npm ERR! mini-create-react-context#"^0.4.0" from react-router#5.2.0
npm ERR! node_modules/react-router
npm ERR! react-router#"5.2.0" from react-router-dom#5.2.0
npm ERR! node_modules/react-router-dom
npm ERR! react-router-dom#"^5.2.0" from the root project
npm ERR! 1 more (the root project)
npm ERR! 6 more (react-dom, react-router, react-router-dom, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^15.3.0 || ^16.0.0-alpha" from react-virtualized#9.22.3
npm ERR! node_modules/rsuite/node_modules/react-virtualized
npm ERR! react-virtualized#"^9.21.0" from rsuite#4.9.3
npm ERR! node_modules/rsuite
npm ERR! rsuite#"*" 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 /home/mikhil/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/mikhil/.npm/_logs/2021-03-22T06_42_23_555Z-debug.log
You try the following command
npm install --force
or
npm install --legacy-peer-deps

How to install node sass?

I have
node - 14.15.4
and
npm - 6.14.10
I am learning React and I want to use reactstrap. But it shows me this error Error: Node Sass version 5.0.0 is incompatible with ^4.0.0. . So I try this:
npm install --save node-sass#4
And now I have this error:
npm WARN bootstrap#4.5.3 requires a peer of jquery#1.9.1 - 3 but none is installed.
You must install peer dependencies yourself.
npm WARN create-react-context#0.3.0 requires a peer of react#^0.14.0 || ^15.0.0 || ^16.0.0 but none is installed.
You must install peer dependencies yourself.
npm WARN react-popper#1.3.7 requires a peer of react#0.14.x || ^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils#3.19.0 requires a peer of typescript#>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path ..\ReactApp\first_app\my-app\node_modules\.node-sass.DELETE\vendor\win32-x64-83\binding.node
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink '..\ReactApp\first_app\my-app\node_modules\.node-sass.DELETE\vendor\win32-x64-83\binding.node'
npm ERR! [OperationalError: EPERM: operation not permitted, unlink '..\ReactApp\first_app\my-app\node_modules\.node-sass.DELETE\vendor\win32-x64-83\binding.node'] {
npm ERR! cause: [Error: EPERM: operation not permitted, unlink '..\ReactApp\first_app\my-app\node_modules\.node-sass.DELETE\vendor\win32-x64-83\binding.node'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: '..\\PROJECTS\\ReactApp\\first_app\\my-app\\node_modules\\.node-sass.DELETE\\vendor\\win32-x64-83\\binding.node'
npm ERR! },
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: '..\PROJECTS\\ReactApp\\first_app\\my-app\\node_modules\\.node-sass.DELETE\\vendor\\win32-x64-83\\binding.node',
npm ERR! parent: 'my-app'
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! ..\AppData\Roaming\npm-cache\_logs\2021-01-12T15_27_11_966Z-debug.log
PS ..\PROJECTS\ReactApp\first_app\my-app>
try to install "npm install node-sass#4.14.0"
To install the working node-sass version, you can use
npm uninstall node-sass
npm install node-sass#4.14.0
you can choose your version number based on the following table, based on ther appropriate node version you have installed
This has solved my problem

Resources