pm2 status reports nuxt version instead of application version
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?
pm2 status displays the version of nuxt instead of the application in the version column
How could we reproduce this issue?
Install pm2, deploy an application develop with nuxt (with nuxt build, so it is a production version).
Upon success, run pm2 status
Supporting information
In the report below, the nuxt_app version is 2.5.0, yet nuxt version is shown: 2.14.12.
Both nuxt_app and normal_app have a package.json in their root folder containing the proper version, i.e. 2.5.0.
pm2 report:
--- PM2 report ----------------------------------------------------------------
Date : Mon Feb 01 2021 09:10:07 GMT+0000 (Coordinated Universal Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version : 4.5.4
node version : 10.23.2
node path : /usr/bin/pm2
argv : /usr/bin/node,/usr/lib/node_modules/pm2/lib/Daemon.js
argv0 : node
user : vagrant
uid : 1000
gid : 1000
uptime : 196min
===============================================================================
--- CLI ----------------------------------------------------
local pm2 : 4.5.4
node version : 10.23.2
node path : /usr/bin/pm2
argv : /usr/bin/node,/usr/bin/pm2,report
argv0 : node
user : vagrant
uid : 1000
gid : 1000
===============================================================================
--- System info --------------------------------------------
arch : x64
platform : linux
type : Linux
cpus : Intel Core Processor (Skylake, IBRS)
cpus nb : 2
freemem : 333475840
totalmem : 1927008256
home : /home/vagrant
===============================================================================
--- PM2 list -----------------------------------------------
--- PM2 list -----------------------------------------------
┌─────┬─────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├─────┼─────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 1 │ nuxt_app │ default │ 2.14.12 │ fork │ 31678 │ 70m │ 1 │ online │ 0% │ 84.7mb │ vagrant │ enabled │
│ 2 │ normal_app │ default │ 2.5.0 │ cluster │ 31667 │ 70m │ 1 │ online │ 0% │ 43.9mb │ vagrant │ enabled │
└─────┴─────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
Module
┌────┬───────────────────────────────────────┬────────────────────┬───────┬──────────┬──────┬──────────┬──────────┬──────────┐
│ id │ module │ version │ pid │ status │ ↺ │ cpu │ mem │ user │
├────┼───────────────────────────────────────┼────────────────────┼───────┼──────────┼──────┼──────────┼──────────┼──────────┤
│ 0 │ pm2-logrotate │ 2.7.0 │ 4271 │ online │ 3 │ 0% │ 40.6mb │ vagrant │
└────┴───────────────────────────────────────┴────────────────────┴───────┴──────────┴──────┴──────────┴──────────┴──────────┘
===============================================================================
--- Daemon logs --------------------------------------------
/home/vagrant/.pm2/pm2.log last 20 lines:
PM2 | 2021-02-01T07:59:45: PM2 log: App [normal_app:2] starting in -cluster mode-
PM2 | 2021-02-01T07:59:45: PM2 log: App [normal_app:2] online
PM2 | 2021-02-01T07:59:45: PM2 log: App [nuxt_app:1] starting in -fork mode-
PM2 | 2021-02-01T07:59:45: PM2 log: App [nuxt_app:1] online
Here is the ecosystem file:
{
"apps": [
{
"name": "nuxt_app",
"cwd": "/usr/local/nuxt_app",
"script": "./node_modules/nuxt/bin/nuxt.js",
"interpreter_args": "",
"args": "start",
"watch": true,
"wait_ready": true,
"merge_logs": true,
"out_file": "/var/log/nuxt_app/nuxt_app.log",
"error_file": "/var/log/nuxt_app/nuxt_app.log",
"env": {
"PORT": 8080
},
"env_production": {
"NODE_ENV": "production"
},
"env_development": {
"NODE_ENV": "development"
}
},
{
"name": "normal_app",
"cwd": "/usr/local/normal_app",
"script": "dist/line_connector.js",
"interpreter_args": "--harmony",
"args": "",
"watch": true,
"wait_ready": true,
"merge_logs": true,
"out_file": "/var/log/normal_app/normal_app.log",
"error_file": "/var/log/normal_app/normal_app.log",
"env": {
"PORT": 3000,
},
"env_production": {
"NODE_ENV": "production"
},
"env_development": {
"NODE_ENV": "development"
},
"exec_mode": "cluster"
},
]
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the report with the supplied ecosystem configuration, comparing the nuxt_app and normal_app package.json files with their output in pm2 status. Start at the pm2 status version display path and trace how the application directory and package version are selected; done means the Nuxt application's package.json version is shown instead of Nuxt's dependency version.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js, nuxt
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100