Unitech / Unitech/pm2

pm2 doesn't recognize script when ommiting .js

Open
#4,810 0 comments 0 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

When starting a Node.js application with the vanilla node command, you can omit the .js file extension and it still runs fine: node index.js can be simplified to node index. However, pm2 start node index.js cannot be simplified to pm2 start node index; it will return a "Script not found" error. It would be really nice to see this shorthand included in pm2!

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

Start by tracing the pm2 start command's argument parsing and script lookup, then reproduce the difference between pm2 start node index.js and pm2 start node index. Done means the extensionless form starts the Node.js script while the existing explicit .js form continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.