I'm setting up a new node/typescript project, and having trouble getting the basics working.
'use strict';
let fetch = require("node-fetch");
Is giving me error TS2304: Cannot find name 'require'.
So I think typings are needed? Tried:
typings install node
typings install nodejs
typings install require
All of which give
Unable to find "XXX" ("npm") in the registry
What is the correct way to get require, or any simple node app working with typescript.
TS is great once you get going, but the shifting sands around initial configuration are quite a hassle to get going. I also looked at this answer, but it doesn't solve this issue. Some of the suggestions there no longer seem to work.
I'm trying to compile down to ES6. typings version 1.0.5
Using a tsconfig.json
and a typings.json
I have copied over from a separate working project and removed as much as possible. I guess I have to go through with tweezers and try to figure out what's different.