I would like to import file-system npm library to my Angular 2 project and strictly followed these steps: https://medium.com/@s_eschweiler/using-external-libraries-with-angular-2-87e06db8e5d1#.1dx1fkiew
Now it's done I have the following basically error and really don't know how am I suppose to import simple npm module to Angular 2 project...
src/app/app.component.ts(2,21): error TS2307: Cannot find module 'file-system'
Here's my app.component.ts file:
import { Component } from '@angular/core';
import * as fs from 'file-system';
@Component({
selector: 'my-app',
templateUrl: 'app/folio.html'
})
export class AppComponent {
name = 'Angular';
src = './app/img/';
dir = fs.readdirSync(src);
}
I tried something related with typings :
typings install file-system
but the module isn't find by typings to be installed.
Does anyone have a solution or know a good tutorial to include any npm modules in Angular 2 project ?
npm installwork without errors (do you have a folder node_modules/file-system/ with all files in it)? Didtsd installsucceed?fsrelated modules in angular.