How to get tsc to Resolve Absolute Paths when Importing Modules using baseUrl?

The answer comes from @DenisPshenov’s comment in one of the answers. It’s buried, so I’ll provide it here…

Tell Node where the base url is with NODE_PATH environment variable so that it can resolve absolute paths:

Linux / macOS

NODE_PATH=dist/ node ./dist/index.js

Windows Powershell

$env:NODE_PATH="dist/"
node ./dist/index.js

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)