I have installed jenkins and trying to run node js app, i am not getting error job was successful
but the application is not bootstrapping
`Running as SYSTEM
Building in workspace /Users/Shared/Jenkins/Home/workspace/mysampleJob
No credentials specified
git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
git config remote.origin.url https://github.com/rajendar38/node-app.git # timeout=10
Fetching upstream changes from https://github.com/rajendar38/node-app.git
git --version # timeout=10
git fetch --tags --force --progress https://github.com/rajendar38/node-app.git +refs/heads/:refs/remotes/origin/
git rev-parse refs/remotes/origin/master^{commit} # timeout=10
git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 99ac0a176e5970eef8c83c8684d57871e325cb37 (refs/remotes/origin/master)
git config core.sparsecheckout # timeout=10
git checkout -f 99ac0a176e5970eef8c83c8684d57871e325cb37
Commit message: "simple node app with test 2"
git rev-list --no-walk 99ac0a176e5970eef8c83c8684d57871e325cb37 # timeout=10
[mysampleJob] $ /bin/sh -xe /Users/Shared/Jenkins/tmp/jenkins1650676890501354031.sh
- export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/go/bin
- PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/go/bin
- npm install
audited 2468 packages in 4.383s
found 55 vulnerabilities (16 low, 19 moderate, 19 high, 1 critical)
runnpm audit fixto fix them, ornpm auditfor details- who am i
jenkins tty?? Jun 29 20:59- pm2 start index.js
[PM2] Spawning PM2 daemon with pm2_home=/Users/Shared/Jenkins/.pm2
[PM2] PM2 Successfully daemonized
[PM2] Starting /Users/Shared/Jenkins/Home/workspace/mysampleJob/index.js in fork_mode (1 instance)
[PM2] Done.
โโโโโโโโโโโโฌโโโโโฌโโโโโโโโโโฌโโโโโโโฌโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโฌโโโโโโฌโโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโโ
โ App name โ id โ version โ mode โ pid โ status โ restart โ uptime โ cpu โ mem โ user โ watching โ
โโโโโโโโโโโโผโโโโโผโโโโโโโโโโผโโโโโโโผโโโโโโโโผโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโผโโโโโโผโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโค
โ index โ 0 โ 0.0.2 โ fork โ 41576 โ online โ 0 โ 0s โ 0% โ 12.4 MB โ jenkins โ disabled โ
โโโโโโโโโโโโดโโโโโดโโโโโโโโโโดโโโโโโโดโโโโโโโโดโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโดโโโโโโดโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโ
Usepm2 show <id|name>to get more details about an app- pm2 list
โโโโโโโโโโโโฌโโโโโฌโโโโโโโโโโฌโโโโโโโฌโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโฌโโโโโโฌโโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโโ
โ App name โ id โ version โ mode โ pid โ status โ restart โ uptime โ cpu โ mem โ user โ watching โ
โโโโโโโโโโโโผโโโโโผโโโโโโโโโโผโโโโโโโผโโโโโโโโผโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโผโโโโโโผโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโค
โ index โ 0 โ 0.0.2 โ fork โ 41576 โ online โ 0 โ 0s โ 27% โ 33.2 MB โ jenkins โ disabled โ
โโโโโโโโโโโโดโโโโโดโโโโโโโโโโดโโโโโโโดโโโโโโโโดโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโดโโโโโโดโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโ
Usepm2 show <id|name>to get more details about an app- pm2 status index.js
โโโโโโโโโโโโฌโโโโโฌโโโโโโโโโโฌโโโโโโโฌโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโฌโโโโโโฌโโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโโ
โ App name โ id โ version โ mode โ pid โ status โ restart โ uptime โ cpu โ mem โ user โ watching โ
โโโโโโโโโโโโผโโโโโผโโโโโโโโโโผโโโโโโโผโโโโโโโโผโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโผโโโโโโผโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโค
โ index โ 0 โ 0.0.2 โ fork โ 41576 โ online โ 0 โ 0s โ 0% โ 33.2 MB โ jenkins โ disabled โ
โโโโโโโโโโโโดโโโโโดโโโโโโโโโโดโโโโโโโดโโโโโโโโดโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโดโโโโโโดโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโ
Usepm2 show <id|name>to get more details about an app
Finished: SUCCESS`
This is only my suggestion:
What I did is to install pm2 during build process and when to run the application just the local pm2 like this
bat 'node_modules\\.bin\\pm2 start ecosystem.config.js --env dev'
bat 'node_modules\\.bin\\pm2 reload all'
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Its late but just help someone in need:
Issue: pm2 would have been installed with ubuntu user or root, which Jenkins can't access
sudo su jenkins (if password is required, setsudo passwd jenkins) npm i -g
pm2Now, Jenkins should be able to run pm2
Most helpful comment
Its late but just help someone in need:
Issue: pm2 would have been installed with ubuntu user or root, which Jenkins can't access
sudo su jenkins(if password is required, setpassword from root user
sudo passwd jenkins)npm i -g pm2Now, Jenkins should be able to run pm2