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:

├─┬ lerna@3.22.1
│ └─┬ @lerna/version@3.22.1
│   └─┬ @lerna/conventional-commits@3.22.0
│     ├─┬ conventional-changelog-core@3.2.3
│     │ ├─┬ conventional-changelog-writer@4.1.0
│     │ │ └─┬ meow@8.1.2
│     │ │   └── trim-newlines@3.0.1
│     │ ├─┬ conventional-commits-parser@3.2.4
│     │ │ └─┬ meow@8.1.2
│     │ │   └── trim-newlines@3.0.1
│     │ └─┬ get-pkg-repo@1.4.0
│     │   └─┬ meow@3.7.0
│     │     └── trim-newlines@1.0.0
│     └─┬ conventional-recommended-bump@5.0.1
│       └─┬ meow@4.0.1
│         └── trim-newlines@2.0.0
└── trim-newlines@4.0.2

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: trim-newlines@2.0.0 C:\path_to\node_modules\meow\node_modules\trim-newlines npm ERR! invalid: trim-newlines@3.0.1 C:\path_to\node_modules\conventional-changelog-writer\node_modules\trim-newlines npm ERR! invalid: trim-newlines@3.0.1 C:\path_to\node_modules\conventional-commits-parser\node_modules\trim-newlines npm ERR! invalid: trim-newlines@1.0.0 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