Angular 2 – Fresh project cannot find module added with npm

Note: the version of Angular 2 is:


@angular/cli: 1.0.0-rc.0
node: 6.9.5
os: win32 x64
@angular/common: 2.4.10
@angular/compiler: 2.4.10
@angular/core: 2.4.10
@angular/forms: 2.4.10
@angular/http: 2.4.10
@angular/platform-browser: 2.4.10
@angular/platform-browser-dynamic: 2.4.10
@angular/router: 3.4.10
@angular/cli: 1.0.0-rc.0
@angular/compiler-cli: 2.4.10

I started a new project Angular 2 using the CLI and just added the parse npm package using


npm install parse --save

So I’m all happy and want to try my new app with ng serve -o and BIMERROR in D:/tangu/Documents/Projects/cannot-find-parse/src/app/app.component.ts (2,21): Cannot find module ‘parse’.)

Here is the commit with the project failing 😥

SOLUTION

I added a file named declarations.d.ts under /src and now it works fine 🙂

Content of src/declarations.d.ts:


declare module '*';

 

Here is the github project: https://github.com/seza443/cannot-find-parse