Cannot find module 'webpack' - Angular

喜欢而已 提交于 2019-11-28 21:19:47
Tristan mariën

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.

softloft

I fixed this issue with:

delete package-lock.json
delete node_modules
delete dist (if exist)

npm cache clean --force

npm install
Sehul Viras

Try to see if this works...

npm uninstall --save webpack
npm install --save-dev webpack

ng update @angular/cli @angular/core

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!