0

Hi everybody
I don't really now if these are called "instances" of a package...anyway, my problem is this: if I run yarn npm audit it shows me a problem with the package trim-newlines and suggests me to upgrade it to a version >=3.0.1 After the upgrade (with yarn up trim-newlines), I run npm ls trim-newlines and this is the output:

├─┬ [email protected]
│ └─┬ @lerna/[email protected]
│   └─┬ @lerna/[email protected]
│     ├─┬ [email protected]
│     │ ├─┬ [email protected]
│     │ │ └─┬ [email protected]
│     │ │   └── [email protected]
│     │ ├─┬ [email protected]
│     │ │ └─┬ [email protected]
│     │ │   └── [email protected]
│     │ └─┬ [email protected]
│     │   └─┬ [email protected]
│     │     └── [email protected]
│     └─┬ [email protected]
│       └─┬ [email protected]
│         └── [email protected]
└── [email protected]

So it looks like there are multiple versions of it. I managed to upgrade the bottom one to latest version, but how do I upgrade the others?

Deffo
  • 191
  • 1
  • 8
  • 21
  • https://stackoverflow.com/questions/15806152/how-do-i-override-nested-npm-dependency-versions/70396201#70396201 Seems relevant. You can use `overrides` in your `package.json`, though there seem to be a few quirks, as mentioned in the replies to that post. – Steve E Jan 20 '23 at 15:45
  • @SteveE I tried it but I get `npm ERR! code ELSPROBLEMS npm ERR! invalid: [email protected] C:\path_to\node_modules\meow\node_modules\trim-newlines npm ERR! invalid: [email protected] C:\path_to\node_modules\conventional-changelog-writer\node_modules\trim-newlines npm ERR! invalid: [email protected] C:\path_to\node_modules\conventional-commits-parser\node_modules\trim-newlines npm ERR! invalid: [email protected] C:\path_to\node_modules\get-pkg-repo\node_modules\trim-newlines` – Deffo Jan 20 '23 at 16:26
  • 1
    You may be able to try some of the suggestions [here](https://sebhastian.com/npm-err-code-elsproblems/) in the **ELSPROBLEMS: Invalid Package** section, though again, even if you manage to upgrade / override it, there's a chance the other dependencies you have may just not work at all, given how far apart the version they're expecting is form the version you'd be providing. – Steve E Jan 23 '23 at 15:29

0 Answers0