Can't install ng2-bootstrap or any other library.
Please provide us with the following information:
- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) El Capitan
-
Versions. Please run
ng --version. If there's nothing outputted, please run in a Terminal: node --version And paste the result here. angular-cli: 1.0.0-beta.1 node: 4.2.6 -
Repro steps. Was this an app that wasn't created using the CLI? What change did you do on your code? etc. Just create a new project and try to install any new library. I even try to install moment following your steps and is not working.
-
The log given by the failure. Normally this include a stack trace and some more information.
-
Mention any other details that might be useful.
Thanks! We'll be in touch soon.
I'm using moment and ng2-bootstrap without issues. My system-config
const map: any = { 'moment': 'vendor/moment/moment.js', 'ng2-bootstrap': 'vendor/ng2-bootstrap' };
/* User packages configuration. / const packages: any = { 'vendor/ng2-bootstrap': { defaultExtension: 'js' } }; My angular build-cli module.exports = function(defaults) { return new Angular2App(defaults, { vendorNpmFiles: [ 'systemjs/dist/system-polyfills.js', 'systemjs/dist/system.src.js', 'zone.js/dist/.js', 'es6-shim/es6-shim.js', 'reflect-metadata/.js', 'rxjs/__/.js', '@angular/**/.js', 'ng2-bootstrap/**/*.js', 'moment/moment.js' ] }); };
Thanks so much for your quick answer.
I'm still having troubles... I tried the configuration you provied. And it's throwing this error.
Then i tried with this configuration. (i'm just going to copy the import statement)
angular-cli-build.js 'ng2-bootstrap/bundles/ng2-bootstrap.js',
system.config.js
const map: any = { 'moment': 'vendor/moment/moment.js', 'ng2-bootstrap': 'vendor/ng2-bootstrap/bundles' };
/** User packages configuration. */ const packages: any = { 'vendor/ng2-bootstrap/bundles': { defaultExtension: 'js' } };
And I'm having this error:

And in both cases this is my component:
import { Component } from '@angular/core'; import {AlertComponent} from 'ng2-bootstrap/ng2-bootstrap'; @Component({ moduleId: module.id, selector: 'coworking-app', templateUrl: 'coworking.component.html', directives: [AlertComponent], styleUrls: ['coworking.component.css'] }) export class CoworkingAppComponent { title = 'coworking works!'; }
I tried importing the bundle file because they do that in the example provided here:
https://github.com/valor-software/angular2-quickstart/blob/master/index.html
thanks for your answer and sorry to bother.
Don't use bundles or try to debug where are these files.
@liongoncalves Where you able to solve the errors you were getting? I am asking as I am getting similar error. Any help in the right direction will be great.
@tushar-chauhan yeah i manage to kinda solve the error. I'm not 100% percent happy with the solution but it works for now. You can check what i did here in this repo. Is a personal project so for me works. But for example. I'm importing the bootstrap css (and other css too) in the index.html file directly, and well i really don't like that, in fact any "global" I'm importing this way (if anyone have a better way to do this with systemjs directly it would be great).
For ng2-bootstrap just check my angular-cli-build.js and app/system.config.js file. In there is most of the configuration. Then just import the component you need to use import {AlertComponent} from 'ng2-bootstrap/ng2-bootstrap'; for example. And that's it.
If you have another question feel free to ask.
@liongoncalves thanks for you repo's link. It worked 😄
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.