14

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

Arvind Maurya
  • 910
  • 12
  • 25
Syed Abrar Jaleel
  • 141
  • 1
  • 1
  • 4

4 Answers4

13

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.

James Ikubi
  • 2,552
  • 25
  • 18
9

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).

1
  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

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

jameseg
  • 730
  • 1
  • 4
  • 19