Skip to content

Cannot find module error with webpack@5 #25

@MikeDevice

Description

@MikeDevice

Sometimes this plugin can break a build with an error when webpack@5 is used:

Cannot find module '<path-to-repo>/node_modules/<lib>/package.json'

It's easy to reproduce this issue. Just add to the project @babel/runtime dependency and try to make a build. The build will be broken with the follow error:

Error: Cannot find module '<path-to-repo>/node_modules/@babel/package.json'

Here is an example repo: webpack-file-dependencies-issue/tree/license-checker-webpack-plugin-example.

Initial issue: webpack/webpack#11971

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions