Unitech / Unitech/pm2

Unable to start scripts through npm

Open
#5,871 2 comments 1 reaction 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

What's going wrong?

I cannot run npm run start

How could we reproduce this issue?

Try pm2 start "npm run start" or pm2 start npm -- start

Supporting information

PS C:\...\Desktop\py\AudioProcessorWhisper\twitch_bot> pm2 start "npm run start"
[PM2][ERROR] Script not found: C:\...\Desktop\py\AudioProcessorWhisper\twitch_bot\npm run start
PS C:\...\Desktop\py\AudioProcessorWhisper\twitch_bot> pm2 start npm -- start
[PM2] Starting C:\PROGRAM FILES\NODEJS\NPM.CMD in fork_mode (1 instance)
[PM2] Done.
[PM2][ERROR] Script not found: C:\...\Desktop\py\AudioProcessorWhisper\twitch_bot\start

Run the following commands

$ pm2 report

--- PM2 report ----------------------------------------------------------------
Date                 : Sun Jul 21 2024 16:58:38 GMT+0530 (India Standard Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version         : 5.4.2
node version         : 20.15.0
node path            : not found
argv                 : C:\Program Files\nodejs\node.exe,C:\Users\Dhruv\AppData\Roaming\npm\node_modules\pm2\lib\Daemon.js
argv0                : node
user                 : undefined
uid                  : N/A
gid                  : N/A
uptime               : 2min
===============================================================================
--- CLI ----------------------------------------------------
local pm2            : 5.4.2
node version         : 20.15.0
node path            : not found
argv                 : C:\Program Files\nodejs\node.exe,C:\Users\Dhruv\AppData\Roaming\npm\node_modules\pm2\bin\pm2,report
argv0                : C:\Program Files\nodejs\node.exe
user                 : Dhruv
===============================================================================
--- System info --------------------------------------------
arch                 : x64
platform             : win32
type                 : Windows_NT
cpus                 : 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
cpus nb              : 16
freemem              : 7028887552
totalmem             : 16823209984
home                 : C:\Users\Dhruv
===============================================================================
--- PM2 list -----------------------------------------------
┌────┬───────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name      │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
└────┴───────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
===============================================================================
--- Daemon logs --------------------------------------------
C:\Users\Dhruv\.pm2\pm2.log last 20 lines:
PM2        | 2024-07-21T16:18:30: PM2 log: App [npm:0] exited with code [1] via signal [SIGINT]
PM2        | 2024-07-21T16:18:30: PM2 log: Script C:\PROGRAM FILES\NODEJS\NPM.CMD had too many unstable restarts (16). Stopped. "errored"
PM2        | 2024-07-21T16:30:54: PM2 log: Stopping app:npm id:0
PM2        | 2024-07-21T16:30:54: PM2 error: app=npm id=0 does not have a pid
PM2        | 2024-07-21T16:56:18: PM2 log: ===============================================================================
PM2        | 2024-07-21T16:56:18: PM2 log: --- New PM2 Daemon started ----------------------------------------------------
PM2        | 2024-07-21T16:56:18: PM2 log: Time                 : Sun Jul 21 2024 16:56:18 GMT+0530 (India Standard Time)
PM2        | 2024-07-21T16:56:18: PM2 log: PM2 version          : 5.4.2
PM2        | 2024-07-21T16:56:18: PM2 log: Node.js version      : 20.15.0
PM2        | 2024-07-21T16:56:18: PM2 log: Current arch         : x64
PM2        | 2024-07-21T16:56:18: PM2 log: PM2 home             : C:\Users\Dhruv\.pm2
PM2        | 2024-07-21T16:56:18: PM2 log: PM2 PID file         : C:\Users\Dhruv\.pm2\pm2.pid
PM2        | 2024-07-21T16:56:18: PM2 log: RPC socket file      : \\.\pipe\rpc.sock
PM2        | 2024-07-21T16:56:18: PM2 log: BUS socket file      : \\.\pipe\pub.sock
PM2        | 2024-07-21T16:56:18: PM2 log: Application log path : C:\Users\Dhruv\.pm2\logs
PM2        | 2024-07-21T16:56:18: PM2 log: Worker Interval      : 30000
PM2        | 2024-07-21T16:56:18: PM2 log: Process dump file    : C:\Users\Dhruv\.pm2\dump.pm2
PM2        | 2024-07-21T16:56:18: PM2 log: Concurrent actions   : 2
PM2        | 2024-07-21T16:56:18: PM2 log: SIGTERM timeout      : 1600
PM2        | 2024-07-21T16:56:18: PM2 log: ===============================================================================

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

Reproduce the issue on Windows with pm2 start "npm run start" and pm2 start npm -- start, then review the accompanying PM2 report and daemon logs. Done means PM2 starts the npm start script without treating npm run start or start as a missing script path.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, devtools
Issue type
Bug
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.