11

I'm trying to run the below command to install ngx-bootstrap to my project

ng add ngx-bootstrap

I end up with this error message. See full CLI output below:

i Using package manager: npm
√ Found compatible package version: ngx-bootstrap@6.2.0.
√ Package information loaded.
√ Package successfully installed.
An unhandled exception occurred: Cannot find module '@schematics/angular/utility/config'
Require stack:
- C:\Users\user\source\repos\DatingApp\client\node_modules\ngx-bootstrap\schematics\ng-add\index.js
- C:\Users\user\source\repos\DatingApp\client\node_modules\@angular-devkit\schematics\tools\export-ref.js
- C:\Users\user\source\repos\DatingApp\client\node_modules\@angular-devkit\schematics\tools\index.js
- C:\Users\user\source\repos\DatingApp\client\node_modules\@angular\cli\utilities\json-schema.js
- C:\Users\user\source\repos\DatingApp\client\node_modules\@angular\cli\models\command-runner.js
- C:\Users\user\source\repos\DatingApp\client\node_modules\@angular\cli\lib\cli\index.js
- C:\Users\user\AppData\Roaming\npm\node_modules\@angular\cli\lib\init.js
- C:\Users\user\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng
See "C:\Users\user\AppData\Local\Temp\ng-qPbtRR\angular-errors.log" for further details.

I tried uninstalling @angular-devkit & @angular/cli and trying again but to no avail.

R. Richards
  • 24,603
  • 10
  • 64
  • 64
skipper
  • 443
  • 1
  • 5
  • 12

3 Answers3

22

I had the same issue, I found the answer that worked for me here: Cannot find module '@schematics/angular/utility/project'

npm uninstall @schematics/angular
npm install @schematics/angular@9.1.0
Dan De Kalb
  • 236
  • 1
  • 3
  • 3
    Had this issue and it was resolved even using Angular 11 – Ryanman Apr 26 '21 at 23:01
  • 1
    Thanks! I had the same issue. I ran the above two commands and then was able to run: ng add ngx-bootstrap Skipping installation: Package already installed Added "bootstrap ✅️ Added "ngx-bootstrap � Installing packages... UPDATE package.json (1353 bytes) UPDATE angular.json (4728 bytes) ✔ Packages installed successfully. – Rich Ward Jun 21 '21 at 17:54
1

i had similar problem on angular-cli version 11.0.2 when run this command

ng add @nguniversal/express-engine

i update @schematics/angular version is 11.0.1

npm install @schematics/angular@11.0.1 

and worked

gizemsever
  • 338
  • 3
  • 13
0

Because ngx-bootstrap require angular schematics module, for that, you need to install angular @schematics

you can install using

npm i @schematics/angular
Hrishikesh Kale
  • 6,140
  • 4
  • 18
  • 27