Closed shikhir-arora closed 6 years ago
Hi @shikhir-arora
Good catch. Indeed it's not critical because it happens only with version containing alpha. But I will fix it anyway.
No problem, I figured it was worth noting because development builds could be prone to more 'need' of the pm2 report
feature.
What's going wrong?
Just a small oversight perhaps, in the development branch currently at
3.0.0-alpha1
,pm2 report
will throw a defined error:[PM2][ERROR] You need to update your Daemon, please type $ pm2 update
.This is obviously not what we want to do and it won't change the result.
This is due to the semvar check here at line 111.
How could we reproduce this issue?
3.0.0-alpha1
) the normal way:Run
pm2 report
after verifying withpm2 --version
that your version is the development/alpha build.The error described above will occur.
Temporary Fix
I just fixed this quickly by changing the check on the above mentioned line to the following, which will parse out the build and is valid for any build that would be checked. The only case where it would return true where you may want it to return false is if someone used
2.6.0-alpha
or any-prerelease
of 2.6.0. That's very unlikely, and even if they were running that, it would fail anyways as it's still the same issue with the semver format.Current snippet:
Changed to the following to fix:
You probably don't need this, but I will follow the guideline (I did get
pm2 report
working, as mentioned above).If this is intentional, I apologize. I looked around and didn't see any other complaints about it on the issues tracker/Git blame, so I thought I'd bring it up since
pm2 report
seems like it'd have use on development builds for actual issues. πSupporting information