storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.55k stars 9.29k forks source link

ERESOLVE unable to resolve dependency tree (html-webpack-plugin) #15238

Closed jmtt89 closed 1 year ago

jmtt89 commented 3 years ago

Describe the bug ERESOLVE unable to resolve dependency tree

To Reproduce

# npm resolution error report

2021-06-14T17:56:35.292Z

Found: html-webpack-plugin@5.3.1
node_modules/html-webpack-plugin
  html-webpack-plugin@"^5.0.0" from @storybook/builder-webpack5@6.3.0-beta.17
  node_modules/@storybook/angular/node_modules/@storybook/builder-webpack5
    peerOptional @storybook/builder-webpack5@"6.3.0-beta.17" from @storybook/core@6.3.0-rc.5
    node_modules/@storybook/angular/node_modules/@storybook/core
      @storybook/core@"6.3.0-rc.5" from @storybook/angular@6.3.0-rc.5
      node_modules/@storybook/angular
        dev @storybook/angular@"^6.3.0-rc.5" from the root project
  html-webpack-plugin@"^5.0.0" from @storybook/builder-webpack5@6.3.0-rc.5
  node_modules/@storybook/builder-webpack5
    dev @storybook/builder-webpack5@"^6.3.0-rc.5" from the root project
  html-webpack-plugin@"^5.0.0" from @storybook/manager-webpack5@6.3.0-rc.5
  node_modules/@storybook/manager-webpack5
    dev @storybook/manager-webpack5@"^6.3.0-rc.5" from the root project

Could not resolve dependency:
peerOptional html-webpack-plugin@">= 2.21.0 < 5" from webpack-subresource-integrity@1.5.2
node_modules/webpack-subresource-integrity
  webpack-subresource-integrity@"1.5.2" from @angular-devkit/build-angular@12.0.4
  node_modules/@angular-devkit/build-angular
    dev @angular-devkit/build-angular@"~12.0.3" from the root project
    peer @angular-devkit/build-angular@">=0.8.9" from @storybook/angular@6.3.0-rc.5
    node_modules/@storybook/angular
      dev @storybook/angular@"^6.3.0-rc.5" from the root project
    peer @angular-devkit/build-angular@">=0.8.9" from @storybook/angular@6.3.0-beta.17
    node_modules/@storybook/addon-essentials/node_modules/@storybook/angular
      peerOptional @storybook/angular@"6.3.0-beta.17" from @storybook/addon-docs@6.3.0-rc.5
      node_modules/@storybook/addon-essentials/node_modules/@storybook/addon-docs
        @storybook/addon-docs@"6.3.0-rc.5" from @storybook/addon-essentials@6.3.0-rc.5
        node_modules/@storybook/addon-essentials
          dev @storybook/addon-essentials@"^6.3.0-rc.5" from the root project

Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

Raw JSON explanation object:

{
  "code": "ERESOLVE",
  "current": {
    "name": "html-webpack-plugin",
    "version": "5.3.1",
    "location": "node_modules/html-webpack-plugin",
    "isWorkspace": false,
    "dependents": [
      {
        "type": "prod",
        "name": "html-webpack-plugin",
        "spec": "^5.0.0",
        "from": {
          "name": "@storybook/builder-webpack5",
          "version": "6.3.0-beta.17",
          "location": "node_modules/@storybook/angular/node_modules/@storybook/builder-webpack5",
          "isWorkspace": false,
          "dependents": [
            {
              "type": "peerOptional",
              "name": "@storybook/builder-webpack5",
              "spec": "6.3.0-beta.17",
              "from": {
                "name": "@storybook/core",
                "version": "6.3.0-rc.5",
                "location": "node_modules/@storybook/angular/node_modules/@storybook/core",
                "isWorkspace": false,
                "dependents": [
                  {
                    "type": "prod",
                    "name": "@storybook/core",
                    "spec": "6.3.0-rc.5",
                    "from": {
                      "name": "@storybook/angular",
                      "version": "6.3.0-rc.5",
                      "location": "node_modules/@storybook/angular",
                      "isWorkspace": false,
                      "dependents": [
                        {
                          "type": "dev",
                          "name": "@storybook/angular",
                          "spec": "^6.3.0-rc.5",
                          "from": {
                            "location": "/home/jtorres/experiments/my-first-project"
                          }
                        }
                      ]
                    }
                  }
                ]
              }
            }
          ]
        }
      },
      {
        "type": "prod",
        "name": "html-webpack-plugin",
        "spec": "^5.0.0",
        "from": {
          "name": "@storybook/builder-webpack5",
          "version": "6.3.0-rc.5",
          "location": "node_modules/@storybook/builder-webpack5",
          "isWorkspace": false,
          "dependents": [
            {
              "type": "dev",
              "name": "@storybook/builder-webpack5",
              "spec": "^6.3.0-rc.5",
              "from": {
                "location": "/home/jtorres/experiments/my-first-project"
              }
            }
          ]
        }
      },
      {
        "type": "prod",
        "name": "html-webpack-plugin",
        "spec": "^5.0.0",
        "from": {
          "name": "@storybook/manager-webpack5",
          "version": "6.3.0-rc.5",
          "location": "node_modules/@storybook/manager-webpack5",
          "isWorkspace": false,
          "dependents": [
            {
              "type": "dev",
              "name": "@storybook/manager-webpack5",
              "spec": "^6.3.0-rc.5",
              "from": {
                "location": "/home/jtorres/experiments/my-first-project"
              }
            }
          ]
        }
      }
    ]
  },
  "currentEdge": null,
  "edge": {
    "type": "peerOptional",
    "name": "html-webpack-plugin",
    "spec": ">= 2.21.0 < 5",
    "error": "INVALID",
    "from": {
      "name": "webpack-subresource-integrity",
      "version": "1.5.2",
      "location": "node_modules/webpack-subresource-integrity",
      "isWorkspace": false,
      "dependents": [
        {
          "type": "prod",
          "name": "webpack-subresource-integrity",
          "spec": "1.5.2",
          "from": {
            "name": "@angular-devkit/build-angular",
            "version": "12.0.4",
            "location": "node_modules/@angular-devkit/build-angular",
            "isWorkspace": false,
            "dependents": [
              {
                "type": "dev",
                "name": "@angular-devkit/build-angular",
                "spec": "~12.0.3",
                "from": {
                  "location": "/home/jtorres/experiments/my-first-project"
                }
              },
              {
                "type": "peer",
                "name": "@angular-devkit/build-angular",
                "spec": ">=0.8.9",
                "from": {
                  "name": "@storybook/angular",
                  "version": "6.3.0-rc.5",
                  "location": "node_modules/@storybook/angular",
                  "isWorkspace": false,
                  "dependents": [
                    {
                      "type": "dev",
                      "name": "@storybook/angular",
                      "spec": "^6.3.0-rc.5",
                      "from": {
                        "location": "/home/jtorres/experiments/my-first-project"
                      }
                    }
                  ]
                }
              },
              {
                "type": "peer",
                "name": "@angular-devkit/build-angular",
                "spec": ">=0.8.9",
                "from": {
                  "name": "@storybook/angular",
                  "version": "6.3.0-beta.17",
                  "location": "node_modules/@storybook/addon-essentials/node_modules/@storybook/angular",
                  "isWorkspace": false,
                  "dependents": [
                    {
                      "type": "peerOptional",
                      "name": "@storybook/angular",
                      "spec": "6.3.0-beta.17",
                      "from": {
                        "name": "@storybook/addon-docs",
                        "version": "6.3.0-rc.5",
                        "location": "node_modules/@storybook/addon-essentials/node_modules/@storybook/addon-docs",
                        "isWorkspace": false,
                        "dependents": [
                          {
                            "type": "prod",
                            "name": "@storybook/addon-docs",
                            "spec": "6.3.0-rc.5",
                            "from": {
                              "name": "@storybook/addon-essentials",
                              "version": "6.3.0-rc.5",
                              "location": "node_modules/@storybook/addon-essentials",
                              "isWorkspace": false,
                              "dependents": [
                                {
                                  "type": "dev",
                                  "name": "@storybook/addon-essentials",
                                  "spec": "^6.3.0-rc.5",
                                  "from": {
                                    "location": "/home/jtorres/experiments/my-first-project"
                                  }
                                }
                              ]
                            }
                          }
                        ]
                      }
                    }
                  ]
                }
              }
            ]
          }
        }
      ]
    }
  },
  "peerConflict": null,
  "strictPeerDeps": false,
  "force": false
}

System Environment Info:

System: OS: Linux 4.19 Ubuntu 20.04.2 LTS (Focal Fossa) CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz Binaries: Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node npm: 7.17.0 - ~/.nvm/versions/node/v14.17.0/bin/npm Browsers: Firefox: 88.0

Additional context package.json

{
  "name": "my-first-project",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test",
    "docs:json": "compodoc -p ./tsconfig.json -e json -d .",
    "storybook": "npm run docs:json && start-storybook -p 6006",
    "build-storybook": "npm run docs:json && build-storybook"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~12.0.3",
    "@angular/common": "~12.0.3",
    "@angular/compiler": "~12.0.3",
    "@angular/core": "~12.0.3",
    "@angular/forms": "~12.0.3",
    "@angular/platform-browser": "~12.0.3",
    "@angular/platform-browser-dynamic": "~12.0.3",
    "@angular/router": "~12.0.3",
    "rxjs": "~6.6.0",
    "tslib": "^2.1.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~12.0.3",
    "@angular/cli": "~12.0.3",
    "@angular/compiler-cli": "~12.0.3",
    "@angular/elements": "^12.0.4",
    "@babel/core": "^7.14.5",
    "@compodoc/compodoc": "^1.1.11",
    "@storybook/addon-actions": "^6.3.0-rc.5",
    "@storybook/addon-essentials": "^6.3.0-rc.5",
    "@storybook/addon-links": "^6.3.0-rc.5",
    "@storybook/angular": "^6.3.0-rc.5",
    "@storybook/builder-webpack5": "^6.3.0-rc.5",
    "@storybook/manager-webpack5": "^6.3.0-rc.5",
    "@types/jasmine": "~3.6.0",
    "@types/node": "^14.17.0",
    "@webcomponents/custom-elements": "^1.4.3",
    "babel-loader": "^8.2.2",
    "jasmine-core": "~3.7.0",
    "karma": "~6.3.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.0.3",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "storybook-addon-angular-ivy": "^0.0.1",
    "typescript": "~4.2.3"
  }
}
shilman commented 1 year ago

We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid.

Please open a new issue referencing this one if: