tslab icon indicating copy to clipboard operation
tslab copied to clipboard

Receiving the Error when trying to run my first program

Open JacobJWalker opened this issue 2 years ago • 2 comments

I just installed TSLab, in Anaconda, and everything was looking good, but when I tried to run the first program:

import * as tslab from 'tslab';

console.log('Hello, tslab!')
console.log('Versions:', tslab.versions)

I received the following error:

Cannot find name 'console'. Do you need to change your target library? Try changing the lib compiler option to include 'dom'.

I tried finding a solution on the Internet, but they talk about changing the tsconfig.json file. But I can't seem to find where that file is. Any help would be greatly appreciated. I love Jupyter, and really need to start to learn TypeScript (and JavaScript)

JacobJWalker avatar Oct 11 '21 18:10 JacobJWalker

same problem here, can not use tslab due to this is. console.log() is really in node.js and not just the browser(dom), can this be supported? if I need supply a tsconfig.js somehow that's fine too.

laoshaw avatar Jan 28 '22 21:01 laoshaw

I started tslab inside a dir with tsconfig.js and now it works

laoshaw avatar Jan 28 '22 21:01 laoshaw