I'm trying to run a typescript script with ts-node in CLI, which means I don't have a package.json.
Here's the command I'm trying to run:
npx -p typescript@latest -p ts-node@latest -p @types/node@latest ts-node -T --project scripts/tsconfig.script.json scripts/my-script.ts
It works perfectly fine when I use relative paths inside the script.
Then I'm trying to enhance it by enabling paths from tsconfig.script.json in order to be able to import from them.
I want to use tsconfig-paths for it. Here're the command I'm trying to run:
npx -p typescript@latest -p ts-node@latest -p @types/node@latest -p tsconfig-paths@latest ts-node -T -r tsconfig-paths/register --project scripts/tsconfig.script.json scripts/my-script.ts
However, I'm getting the following error:
Error: Cannot find module 'tsconfig-paths/register'
I've tried to play around with order of arguments of ts-node as well as adding/removing options, however, I still cannot make it work and see the tsconfig-paths package.
Am I missing smth?
Thanks in advance