Open KhanhPham2411 opened 3 years ago
What version of node do you have installed?
Hi Don,
Thanks for looking into this, please take a look at this replicated minimal code:
export class Test {
static async getDate(a, b){
return new Promise((resolve) => {
resolve(new Date().valueOf());
});
}
}
I am using Node v14.17.0
I believe the problem is because you don't have typescript installed. When importing external typescript files, you might have to isntall typescript in your project folder. Please could you try that for now.
I'll see what can be done to get this working without installing typescript (for external files)
@KhanhPham2411 Please let me know if that works (as a temporary work around)
Your TS code must be in a location where ts-node can find a tsconfig.json
file for it. For example, in the same or parent folder:
{
"compilerOptions": {
"module": "commonjs",
"target": "ES2019",
}
}
Setting the target implicitly sets the lib values
I got this error when trying to import my code:
Any suggestion to fix it would be appreciated