connected-web / product-monitor

A HTML/JavaScript template for monitoring a product by encouraging product developers to gather all the information about the status of a product, including live monitoring, statistics, endpoints, and test results into one place.
8 stars 3 forks source link

npmStatus endpoint does not work correctly if npm is below 2.0.0~ #33

Closed Markavian closed 9 years ago

Markavian commented 9 years ago

This command fixes the issue: sudo npm install npm -g

The command detects the issue: npm --version For example:

Also useful information: node -v For example:

johnbeech commented 9 years ago

Added the npm --version and node --version commands as information on the npmStatus endpoint, but stopped short of implementing any logical updates.

/api/npmStatus response now looks like this (with a versions block):

{
    "data": {
        "request": {
            "current": "2.58.0",
            "wanted": "2.58.0",
            "latest": "2.60.0",
            "location": "node_modules/request",
            "level": 1,
            "updateRequired": false
        }
    },
    "message": "No updates required; but some dependent libraries at lower levels in the tree have less-than-current depdendencies.",
    "error": false,
    "cacheDuration": "30 minutes",
    "command": "npm outdated  --json=true",
    "updatesRequired": false,
    "versions": {
        "npm": {
            "current": "2.13.1",
            "minimumRequirement": "2.13.1"
        },
        "node": {
            "current": "v0.10.29",
            "minimumRequirement": "v0.10.29"
        }
    }
}