且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

找不到模块'webpack'-Angular

更新时间:2022-06-20 10:06:33

我遇到了同样的问题,并且对我有用:

I had the same issue and this worked for me:

  1. 删除这些文件/文件夹(从Angular根文件夹中):

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

  • package-lock.json(不是 package.json)
  • /node_modules文件夹
  • /dist文件夹
  • package-lock.json (Not the package.json)
  • /node_modules folder
  • /dist folder

执行命令(重新生成package-lock.json/node_modules):

Execute command (regenerate the package-lock.json and the /node_modules):

  • $npm install

现在一切正常,是package-lock.json导致npm下载旧版本的依赖项.

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