Unitech / Unitech/pm2

support node exec typescript file

Open
#6,014 0 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

  • 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source files or tests are named. Start by reproducing the PM2 cluster launch with a TypeScript file on Node v24, then trace how PM2 selects and loads the TypeScript interpreter; done means the file runs without requiring ts-node or tsx and existing cluster startup remains unaffected.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
cli, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.