0

I have been trying to fix my dependency issues, which looks like this currently using npm audit

nth-check  <2.0.1
Severity: high
Inefficient Regular Expression Complexity in nth-check - https://github.com/advisories/GHSA-rp65-9cf3-cjxr
fix available via `npm audit fix --force`
Will install react-scripts@2.1.3, which is a breaking change
node_modules/svgo/node_modules/nth-check
  css-select  <=3.1.0
  Depends on vulnerable versions of nth-check
  node_modules/svgo/node_modules/css-select
    svgo  1.0.0 - 1.3.2
    Depends on vulnerable versions of css-select
    node_modules/svgo
      @svgr/plugin-svgo  <=5.5.0
      Depends on vulnerable versions of svgo
      node_modules/@svgr/plugin-svgo
        @svgr/webpack  4.0.0 - 5.5.0
        Depends on vulnerable versions of @svgr/plugin-svgo
        node_modules/@svgr/webpack
          react-scripts  >=2.1.4
          Depends on vulnerable versions of @svgr/webpack
          node_modules/react-scripts

I read an article that mentioned to update the dependencies one at a time, which I tried. But whenever I run a command, the following pops up

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @material-ui/core@4.12.4
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.0 || ^17.0.0 || ^18.0.0" from @react-spring/animated@9.7.3
npm ERR!   node_modules/@react-spring/animated
npm ERR!     @react-spring/animated@"~9.7.3" from @react-spring/core@9.7.3
npm ERR!     node_modules/@react-spring/core
npm ERR!       @react-spring/core@"~9.7.3" from @react-spring/konva@9.7.3
npm ERR!       node_modules/@react-spring/konva
npm ERR!         @react-spring/konva@"~9.7.3" from react-spring@9.7.2
npm ERR!         node_modules/react-spring
npm ERR!       5 more (@react-spring/native, @react-spring/three, ...)
npm ERR!     @react-spring/animated@"~9.7.3" from @react-spring/konva@9.7.3
npm ERR!     node_modules/@react-spring/konva
npm ERR!       @react-spring/konva@"~9.7.3" from react-spring@9.7.2
npm ERR!       node_modules/react-spring
npm ERR!         react-spring@"^9.0.0-rc.3" from react-toggle-dark-mode@1.1.1
npm ERR!         node_modules/react-toggle-dark-mode
npm ERR!     4 more (@react-spring/native, @react-spring/three, ...)
npm ERR!   26 more (@react-spring/core, @react-spring/konva, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0 || ^17.0.0" from @material-ui/core@4.12.4
npm ERR! node_modules/@material-ui/core
npm ERR!   @material-ui/core@"^4.12.4" 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.8.0 || ^17.0.0" from @material-ui/core@4.12.4
npm ERR!   node_modules/@material-ui/core
npm ERR!     @material-ui/core@"^4.12.4" 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.

Furthermore, I can't even uninstall or update @material-ui through npm commands as the same error pops up. Any help would be greatly appreciated !!!

Trying to update the dependencies, I expected to just be able to update them and be done with it, but apparently not. The project (website) runs fine on my computer, but I have been trying to put it up with netlify, which gives me dependency errors. ** I have used --legacy-peer-deps when installing, however, Netlify can't initialize it for some reason.

Kevin W
  • 19
  • 3

0 Answers0