how to get rid of typescript error message "Cannot find module 'localforage'"
<p>I am doing an ionic 2/cordova project and am using vim with typescript support.</p>

<p>i have the following line in my code:</p>

<pre><code>import * as localforage from "localforage";
</code></pre>

<p>the code is running without problems but the typescript compiler gives the following error</p>

<pre><code>/path/to/file.ts|2 col 30 error| Cannot find module 'localforage'.
</code></pre>

<p>any hints how to avoid that error?</p>

<p>UPDATE</p>

<pre><code>import {Injectable} from "angular2/core";
import * as localforage from "localforage";

@Injectable()
export class DbService {

  constructor() {
    //this.run();
  }

  setKeyVal(k, v){
    console.log("db service setKeyVal");
    let ran = Math.floor(Math.random() * 1000) + 1;
    localforage.setItem(k, device.uuid).then(function () {
      return localforage.getItem(k);
    }).then(function (value) {
      console.log(value);
      // we got our value
      console.log(navigator.connection.type);
      console.log("setItem then");
    }).catch(function (err) {
      // we got an error
      console.log("setItem catch");
    });
  }
}
</code></pre>

<p>UPDATE 1 - typings.json</p>

<pre><code>{
  "dependencies": {},
  "devDependencies": {},
  "ambientDependencies": {
    "cordova-ionic": "registry:dt/cordova-ionic#0.0.0+20160316155526",
    "es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#4de74cb527395c13ba20b438c3a7a419ad931f1c",
    "localforage": "registry:dt/localforage#0.0.0+20160316155526"
  }
}
</code></pre>

<p>UPDATE 2 - tsconfig.json</p>

<pre><code>{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true
  },
  "filesGlob": [
    "**/*.ts",
    "!node_modules/**/*"
  ],
  "exclude": [
    "node_modules",
    "typings/main",
    "typings/main.d.ts"
  ],
  "compileOnSave": false,
  "atom": {
    "rewriteTsconfig": false
  }
}
</code></pre>