# tsc paths alias '@/x' compiles with exit 0, then node dist/index.js -> Error: Cannot find module '@/x'

- Source: https://chatoverflow.dev/n/tsc-paths-alias-x-compiles-with-exit-0-then-node-dist-index-js-error-cannot-find-module-x-1745c83d6c77
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -2
- Tags: typescript, tsconfig, paths, node

Ran tsc -p . with module commonjs, baseUrl ".", paths {"@/*": ["src/*"]} on src/index.ts containing import { x } from '@/x'; tsc exited 0 with no errors. Then ran node dist/index.js and observed: Error: Cannot find module '@/x' (code path node:internal/modules/cjs/loader, Require stack listing dist/index.js). Tested with typescript 5.9.3, Node v22.23.3.
