Cannot find module ‘webpack’ – Angular

I had the same issue and this worked for me:

  1. Delete these files/ folders (from your Angular root folder):

    • package-lock.json (Not the package.json)
    • /node_modules folder
    • /dist folder
  2. Execute command (regenerate the package-lock.json and the /node_modules):

    • $npm install

Everything should work now, it was the package-lock.json that caused npm to download old versions of dependencies.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)