question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`ng add @ng-bootstrap/ng-bootstrap` fails in Angular CLI 10.0.0

See original GitHub issue

Bug description:

The system throws error during ng-bootstrap installation:

[error] Error: Cannot find module '@schematics/angular/utility/project'
Require stack:
- C:\angular\gis-semantics-framework\node_modules\@ng-bootstrap\ng-bootstrap\schematics\ng-add\index.js
- C:\angular\gis-semantics-framework\node_modules\@angular-devkit\schematics\tools\export-ref.js
- C:\angular\gis-semantics-framework\node_modules\@angular-devkit\schematics\tools\index.js
- C:\angular\gis-semantics-framework\node_modules\@angular\cli\utilities\json-schema.js
- C:\angular\gis-semantics-framework\node_modules\@angular\cli\models\command-runner.js
- C:\angular\gis-semantics-framework\node_modules\@angular\cli\lib\cli\index.js
- C:\Users\fiona\AppData\Roaming\npm\node_modules\@angular\cli\lib\init.js
- C:\Users\fiona\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
    at Function.Module._load (internal/modules/cjs/loader.js:842:27)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\angular\gis-semantics-framework\node_modules\@ng-bootstrap\ng-bootstrap\schematics\ng-add\index.js:6:19)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at new ExportStringRef (C:\angular\gis-semantics-framework\node_modules\@angular-devkit\schematics\tools\export-ref.js:19:25)
    at NodeModulesEngineHost._resolveReferenceString (C:\angular\gis-semantics-framework\node_modules\@angular-devkit\schematics\tools\node-module-engine-host.js:95:21)
    at NodeModulesEngineHost.createSchematicDescription (C:\angular\gis-semantics-framework\node_modules\@angular-devkit\schematics\tools\file-system-engine-host-base.js:174:34)
    at SchematicEngine.createSchematic (C:\angular\gis-semantics-framework\node_modules\@angular-devkit\schematics\src\engine\engine.js:220:38)
    at CollectionImpl.createSchematic (C:\angular\gis-semantics-framework\node_modules\@angular-devkit\schematics\src\engine\engine.js:70:29)

Versions of Angular, ng-bootstrap and Bootstrap:

Angular CLI: 10.0.0
Node: 12.18.0
OS: win32 x64

Angular: 10.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.1000.0
@angular-devkit/build-angular     0.1000.0
@angular-devkit/build-optimizer   0.1000.0
@angular-devkit/build-webpack     0.1000.0
@angular-devkit/core              10.0.0
@angular-devkit/schematics        10.0.0
@ngtools/webpack                  10.0.0
@schematics/angular               10.0.0
@schematics/update                0.1000.0
rxjs                              6.5.5
typescript                        3.9.5
webpack                           4.43.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:11

github_iconTop GitHub Comments

2reactions
chenfionacommented, Jun 27, 2020

Problem of Angular CLI 10.0.0:

Severity -> TypeScript configuration issue | Warning Experimental support for decorators is a feature that is subject to change in a future release. Set the ‘experimentalDecorators’ option to remove this warning. This warning pops up as soon as I import the Angular project into IDE. Workaround -> tweak tsconfig.json "compilerOptions": { "experimentalDecorators": true,} This negates the stated: Starting with version 10 you will see a new tsconfig.base.json. This additional tsconfig.json file better supports the way that IDEs and build tooling resolve type and package configurations.

Severity -> Workspace configuration and npm dependencies issue | High >**npm install @ng-bootstrap/ng-bootstrap** npm WARN @ng-bootstrap/ng-bootstrap@6.1.0 requires a peer of @angular/common@^9.0.0 but none is installed. You must install peer dependencies yourself. npm WARN @ng-bootstrap/ng-bootstrap@6.1.0 requires a peer of @angular/core@^9.0.0 but none is installed. You must install peer dependencies yourself. npm WARN @ng-bootstrap/ng-bootstrap@6.1.0 requires a peer of @angular/forms@^9.0.0 but none is installed. You must install peer dependencies yourself. npm WARN @ng-bootstrap/ng-bootstrap@6.1.0 requires a peer of @angular/localize@^9.0.0 but none is installed. You must install peer dependencies yourself. npm WARN @ng-bootstrap/ng-bootstrap@6.1.0 requires a peer of tslib@^1.10.0 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\watchpack-chokidar2\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) 1st Workaround -> tweak the package.json, change 10.x.x to 9.x.x: "dependencies": { "@angular/common": "~10.0.0", "@angular/compiler": "~10.0.0", "@angular/core": "~10.0.0", "@angular/forms": "~10.0.0", }, "devDependencies": { "@angular-devkit/build-angular": "~0.1000.0", "@angular/cli": "~10.0.0", "@angular/compiler-cli": "~10.0.0", Result -> ng-bootstrap is seemingly installed, but the Ngb modules don’t work. 2nd Workaround -> tweak the polyfills.ts: What is missing in CLI 10.0.0 -> import '@angular/localize/init';

Severity -> API compatibility issue | Showstopper ng-bootstrap seemingly functioned, but all of the styling goes awry. UI looks like the aftermath of wreaked plastic surgery.
Workaround -> Complete uninstall and clean CLI 10.0.0, install CLI 9.1.8., migrate project.

1reaction
coderhhcommented, Jun 27, 2020

Got the same issue. Have to downgrade angular cli to 9.18.

Read more comments on GitHub >

github_iconTop Results From Across the Web

`ng add @ng-bootstrap/ng-bootstrap` fails in Angular CLI 10.0.0
Unable to find compatible package. Using 'latest'. Package has unmet peer dependencies. Adding the package may not succeed.
Read more >
Error when installing ng add @ng-bootstrap/ng-bootstrap
There comes an error when installing ng-bootstrap to my Angular-CLI(11.0.4). When ng add @ng-bootstrap/ng-bootstrap. And my log file
Read more >
NG Bootstrap - npm
If you have an Angular CLI project, you could simply use our schematics to add ng-bootstrap library to it. Just run the following:...
Read more >
Getting Started - Angular powered Bootstrap
If you have an Angular CLI project, you could simply use our schematics to add ng-bootstrap library to it. Just run the following:...
Read more >
@ng-bootstrap/ng-bootstrap | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found