You can run a JavaScript scratch file using the corresponding action in its right-click menu:
Typescript scratch files can't be run for the same reason as non-scratch .ts files: Typescript can't be executed directly, it has to be transpiled to JavaScript first
You can run a JavaScript scratch file using the corresponding action in its right-click menu:
Typescript scratch files can't be run for the same reason as non-scratch .ts files: Typescript can't be executed directly, it has to be transpiled to JavaScript first
Thanks, can i use something like ts-node to run my .ts scratch files?
You can try using
--require ts-node/register
in your run configuration, like:of course, you have to install
ts-node
in your project firstThanks, it works! I also can have `ts-node` installed globally? To remove a need to install it in every project.
requiring global modules doesn't usually work, unless you use special tricks like
NODE_PATH;
note that requiring global modules is not recommended:
Just trying to run the file created an SQL run configuration for me. It told me "Error: No configured target data sources", which doesn't make sense.
Instead, I created a local package.json that contained this line, and then I clicked the play button next to that.