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
I found the solution was to use the TSD command:
tsd install node --save
Which adds/updates the typings/tsd.d.ts
file and that file contains all the type definitions that are required for a node application.
At the top of my file, I put a reference to the tsd.d.ts
like this:
///
The require is defined like this as of January 2016:
declare var require: NodeRequire;
interface NodeModule {
exports: any;
require: NodeRequireFunction;
id: string;
filename: string;
loaded: boolean;
parent: any;
children: any[];
}