I am trying to create my first NodeJS application, however I couldn't make it work.
These are the steps I followed so far from various blogs and trying to build first nodejs app in typescript.
npm install -g express-generator
npm install -g typescript
express SampleApp
npm install -g typings
typings install dt~node --global
typings install dt~express dt~serve-static dt~express-serve-static-core --global
cd SampleApp
npm install
hello.ts
import express = require('express');
var app = express();
When I build compile the ts file with TypeScript
>>> tsc -m commonjs -t es5 hello.ts
hello.ts(1,26): error TS2307: Cannot find module 'express'.
I have gone through various resources, couldn't find the solution. I guess I don't have to copy node.d.ts and express.d.ts files manually to the project folder.
If I use nodejs and expressjs alone npm start it works fine. Typescript plugin is something I am not able to do
Can anyone help what exactly I am doing wrong here?
express SampleAppyou need to runnpm installin the generated project directory.