Answer the question
In order to leave comments, you need to log in
Terminal `node ./src/index.ts` SyntaxError?
import * as yargs from 'yargs';
const newYargs = yargs.argv;
console.log(newYargs.value);
Answer the question
In order to leave comments, you need to log in
Compile the project. Well, it's generally, since you have a typescript file, I assume that you will use the features of the typescript.
And if specifically about ES6-style imports, then the --experimental-modules key and the .mjs extension, or the type:module field in package.json will solve the problem.
install (can be globally)
https://www.npmjs.com/package/ts-node
and run from it
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question