Skip to content

support node exec typescript file #6014

@JYbill

Description

@JYbill
  • node v24 can run ts file without ts-node/tsx...
  • pm2 using node exec ts file will get error, It does not affect the startup of the cluster
2025-07-14T09:13:48: PM2 log: App [wzj2:4] starting in -cluster mode-
Failed to load Typescript interpreter: Cannot find module 'ts-node/register'
Require stack:
- /usr/local/lib/node_modules/pm2/lib/ProcessContainer.js

# in docker container
pm2 list
┌────┬──────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name             │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├────┼��─────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 1  │ wzj2             │ default     │ 2.0.0   │ cluster │ 188      │ 3m     │ 1    │ online    │ 0%       │ 254.5mb  │ root     │ disabled │
│ 2  │ wzj2             │ default     │ 2.0.0   │ cluster │ 189      │ 3m     │ 1    │ online    │ 0%       │ 179.1mb  │ root     │ disabled │
│ 3  │ wzj2             │ default     │ 2.0.0   │ cluster │ 204      │ 3m     │ 1    │ online    │ 0%       │ 258.0mb  │ root     │ disabled │
│ 4  │ wzj2             │ default     │ 2.0.0   │ cluster │ 205      │ 3m     │ 1    │ online    │ 0%       │ 280.9mb  │ root     │ disabled │
└────┴──────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘

I didn't see any instructions in the document regarding the default use of the ts loader, its very strange.
maybe we cloud use node.js exec typescript file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions