Cannot find module '@angular-builders/custom-webpack/package.json'

24.8k Views Asked by At

I'm following the document on single-spa for angular. My angular version is 11+. I followed the steps from https://single-spa.js.org/docs/ecosystem-angular/#angular-cli through https://single-spa.js.org/docs/ecosystem-angular/#finish-installation successfully. But as subsequent step when I complete https://single-spa.js.org/docs/ecosystem-angular/#configure-routes and run the script at https://single-spa.js.org/docs/ecosystem-angular/#serving at npm run serve:single-spa (npm run serve:single-spa:my-app) actually, I get the following error: Cannot find module @angular-builders/custom-webpack/.. Can anyone point out why this may be occuring and what's the remedy for this ? This is the relevant log file enter image description here

4

There are 4 best solutions below

0
Jeffrey Brewster On

Did you try: "npm i -D @angular-builders/custom-webpack" in your SPA directory?

reference: https://www.npmjs.com/package/@angular-builders/custom-webpack

(Worked for me).

0
James Ikubi On

You probably just forgot to run npm install before running your application. This was the problem in my case.

Another solution you can try is to delete package-lock.json then npm install again if you already have the node modules installed.

0
Daniyal Ali On
  1. Go to the package.json file.
  2. add "@angular-builders/custom-webpack": "^12.0.0"
  3. to find the latest version of @angular-builders/custom-webpack go this link https://www.npmjs.com/package/@angular-builders/custom-webpack?activeTab=versions and pick the latest version.
  4. then npm install again
0
jameseg On

For me it was "builderS" (what it should be) vs "builder" (what I had) which I incorrectly typed into my angular.json