1

happy new year!

Any package that I am trying to install I am getting this:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @rollup/pluginutils@3.1.0
npm ERR! Found: dev @rollup/plugin-typescript@"^3.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev @rollup/plugin-typescript@"^3.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
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See ~/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     ~/.npm/_logs/2022-01-02T16_54_42_026Z-debug.log

I am trying to use this npm install --save @fortawesome/fontawesome-free

I don't understand what could be wrong.

eeq
  • 2,108
  • 12
  • 21
  • Just tried this on Linux using NPM 8.1.3 and 8.3.0 and it worked without any problem. Maybe you can tell something about what version of NPM you got and what OS you are using? – Avec Jan 03 '22 at 08:02
  • npm 8.1.2 and MacOS 12.0.1 Monterrey – yeferson cordoba Jan 04 '22 at 02:16
  • Are you able to upgrade NPM to see if that might help? Also did you try with `--force`. I am no NPM expert but removing `@rollup/plugin-typescript` 3.0.0 and give it another go maybe? Also consider tag this question with NPM to reach more people. – Avec Jan 04 '22 at 10:50

4 Answers4

1

as it said in the error, you are handling an old package dependency and therefore you can use --force, or --legacy-peer-deps

Another solution that worked for me, and I think is better, try to install it through pnpm, as it seems to handle it.

Rom Kadria
  • 61
  • 2
1

I will guess you have decided to update npm itself recently on your local env.

if you run the following (as per your error message), it should install dependencies without trouble.

npm i --legacy-peer-deps

Running npm v8+ to update your dependencies will upgrade the version of your package-lock.json. The issue is that your repo libraries have many old dependencies which might not be compatible with this update. When you run npm with --legacy-peer-deps it uses the old ways...

The Fabio
  • 5,369
  • 1
  • 25
  • 55
0

I have encountered similar problems. After checking, I found that the primary group permission of the node program home directory is 500.500, which needs to be set to root root

90linux
  • 134
  • 3
0

Did you try this :

sudo npm install --save @fortawesome/fontawesome-free