This is what I have done:
npm install firebase --save
typings install npm~firebase --save
After executing the above commands, my typings.json file now looks like this:
{
"ambientDevDependencies": {
"angular-protractor": "registry:dt/angular-protractor#1.5.0+20160425143459",
"jasmine": "registry:dt/jasmine#2.2.0+20160412134438",
"selenium-webdriver": "registry:dt/selenium-webdriver#2.44.0+20160317120654"
},
"ambientDependencies": {
"es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654"
},
"dependencies": {
"firebase": "registry:npm/firebase#3.0.5+20160723033700"
}
}
To import Firebase in a *.ts file, I am using the following syntax:
import * as firebase from 'firebase';
However, upon compilation, I encountered the following error message:
src/app/services-common/database.service.ts (2, 27): Cannot find module 'firebase'.
at BroccoliTypeScriptCompiler._doIncrementalBuild (C:\testapp\node_modules\angular-cli\lib\broccoli\broccoli-typescript.js:120:19)
What steps should I take to resolve this issue? What might be causing this problem?