Skip to content

How to use the server with Typescript #902

Answered by delucis
jakehsiao asked this question in Q&A
Discussion options

You must be logged in to vote

As @larry801 says, you need to compile the .ts file to plain JavaScript before running it with Node.

One other option is to use something like ts-node, which allows you to transpile and run from a single command (like ts-node ./server.ts). There are some limitations with ES modules, so you may need to tweak tsconfig.json to get this working correctly.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@sridharraman
Comment options

@jennyxing
Comment options

@sridharraman
Comment options

Answer selected by delucis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #874 on February 02, 2021 09:28.