I am trying to get my first TypeScript and DefinitelyTyped Node.js application up and running, and running into some errors.
I am getting the error \"TS2304: Cannot
Did you specify what module to use to transpile the code?
tsc --target es5 --module commonjs script.ts
You must do that to let the transpiler know that you're compiling NodeJS code. Docs.
You must install mongoose definitions as well
tsd install mongoose --save
Do not use var to declare variables (unless necessary, which is a very rare case), use let instead. Learn more about that