Angular-builders: Cannot find module 'webpack' after upgrade of custom-webpack to version 11

Created on 9 Apr 2021  路  2Comments  路  Source: just-jeb/angular-builders

This might be totally my fault, but I cannot find the solution for this issue: I have an Angular project, where I use custom-webpack and the license-checker-webpack-plugin. After upgrading to version 11.1.1 I get the following error:

An unhandled exception occurred: Cannot find module 'webpack'
Require stack:
- /build/UI/node_modules/license-checker-webpack-plugin/src/index.js
- /build/UI/webpack.config.js
- /build/UI/node_modules/@angular-builders/custom-webpack/dist/custom-webpack-builder.js
...

my webpack.config.js is the following:

const LicenseCheckerWebpackPlugin = require('license-checker-webpack-plugin');

module.exports = {
  plugins: [
    new LicenseCheckerWebpackPlugin({
      outputFilename: '../open_source.txt',
      allow: '(Apache-2.0 OR BSD-2-Clause OR BSD-3-Clause OR MIT OR 0BSD)',
    }),
  ],
};

How can I solve this?

Most helpful comment

Probably a damaged lock file. Would you mind trying to delete it (and node_modules) and regenerate by running npm install again?

All 2 comments

Probably a damaged lock file. Would you mind trying to delete it (and node_modules) and regenerate by running npm install again?

yeah, that's it. Thanks a lot :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pkaufi picture pkaufi  路  9Comments

just-jeb picture just-jeb  路  3Comments

enten picture enten  路  10Comments

yuwu9145 picture yuwu9145  路  6Comments

renatoaraujoc picture renatoaraujoc  路  6Comments