1
votes

Decided to not to use the webpack for my project. When I removed it from package.json getting below error on ng s.

Cannot find module 'webpack' Error: Cannot find module 'webpack' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:609:15) at Function.Module._load (internal/modules/cjs/loader.js:535:25) at Module.require (internal/modules/cjs/loader.js:663:17) at require (internal/modules/cjs/helpers.js:20:18) at Object. (C:\AI Ops\Code\aiopsuidemo\node_modules@angular-devkit\build-webpack\src\webpack\index.js:6:17) at Module._compile (internal/modules/cjs/loader.js:734:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10) at Module.load (internal/modules/cjs/loader.js:626:32) at tryModuleLoad (internal/modules/cjs/loader.js:566:12) at Function.Module._load (internal/modules/cjs/loader.js:558:3)

Could anyone please suggest what could be the issue ?

1

1 Answers

2
votes

Angular cli uses '@angular-devkit/build-angular' for building the project which has a dependency of 'webpack' (can be found in this link https://www.npmjs.com/package/@angular-devkit/build-angular. this might be the issue.

So, try npm install and then run ng serve.