parcel-bundler / parcel

The zero configuration build tool for the web. 📦🚀
https://parceljs.org
MIT License
43.36k stars 2.26k forks source link

Unmet peer dependency svgo 3 in optimizer-htmlnano #8948

Open CxRes opened 1 year ago

CxRes commented 1 year ago

It seems htmlnano 2.0.4 used by optimizer-htmlnano wants svgo ^3.0.2 as a peer dep. optimizer-htmlnano loads svgo 2.8.0 instead. Please update accordingly.

mischnic commented 1 year ago

Looks like we'll have to restrict the version to <=2.0.3 though, upgrading svgo might break existing config files. https://github.com/svg/svgo/releases/tag/v3.0.0

imbdb commented 1 year ago

Is there any workaround that I can do before this can be solved?

munkacsimark commented 1 year ago

You can skip peer dependency check, but make sure everything is working correctly if you doing it. I encountered this using pnpm, here is the related documentation: https://pnpm.io/npmrc#strict-peer-dependencies

Put strict-peer-dependencies=false into .npmrc file.

aiktb commented 9 months ago

strict-peer-dependencies=false doesn't work, add the following configuration to package.json:

"pnpm": {
    "peerDependencyRules": {
      "allowedVersions": {
        "svgo": "2.8.0",
      }
    }
  },
shallker commented 4 months ago

Another option is to tell pnpm to ignore svgo@^3.0.2 in package.json

{
  "pnpm": {
    "peerDependencyRules": {
      "ignoreMissing": [
        "svgo@^3.0.2"
      ]
    }
  }
}
Lazerbeak12345 commented 1 month ago

related #9660 (the other issue may be a duplicate of this one)