npm search API returns incorrect version & date fields

registry

(Katie Gengler) #1

What I Wanted to Do

Retrieve up-to-date data about an npm package using the search API

The API endpoint (http://registry.npmjs.org/-/v1/search?text=keywords:ember-addon&size=250&from=0) returns outdated date & version fields for some packages. For example, ember-awesome-macros the data returned is:

{
  "package": {
    "name": "ember-awesome-macros",
    "scope": "unscoped",
    "version": "1.0.1",
    "description": "A collection of Ember computed macros",
    "keywords": [
      "ember-addon",
      "macros"
    ],
    "date": "2018-06-22T10:38:12.995Z",
    // truncated for clarity
}

Per https://www.npmjs.com/package/ember-awesome-macros the latest version of ember-awesome-macros is v2.0 as of July 6, 2018.

What Happened Instead

The API returned the date and version of an older release.

Reproduction Steps

Using the search API, find a recently updated package in the results. Compare the date & version fields to the date and version that was recently released.

Details

This bug is also visible in the search on the website. (npm website)/search?q=ember%20awesome will show ember-awesome-macros in the results with v1.0.1 and 21 days ago as the version and date respectively.

For another package example, ember-cli-uniq and (npm website)/search?q=ember%20uniq

(Strange links are due to the limits on no more than two links in a post for new users)

Platform Info

N/A


(Kat Marchán) #2

This is likely part of an ongoing incident:

https://status.npmjs.org/incidents/frcp18csxlks

Please subscribe there and there will hopefully be a resolution soon. We were a bit distracted with a different one today :sweat_smile:


(Katie Gengler) #3

Thanks again for the quick reply. I definitely understand about the incident today. I only noticed both of these problems because I went to see which ember addons published during the affected time :slight_smile:


(R J Davis) #4

I have been experiencing the same issue for several days on a new package that I published. version, keywords, and date do not show from the CLI and from search on npmjs.com. I am able to install the dependency properly from CLI since @latest tag is pulling back the proper version (0.1.2). Details page on npmjs.com also shows the correct version and tags.


(Spencer) #5

I’ve noticed that your issue @rjdavis happens as well. Any pre-release version (between 0.0.0 and 1.0.0) tends to be incredibly behind in most recent version when I install @latest tag. This has happened across a bunch of modules of mine.

The second I update it to 1.0.0 and above, versions start working properly again.


(Kat Marchán) #6

The incident has been resolved, so this works again. Cheers!


(Domain) #7

I have been experiencing the same issue again.
https://api.npms.io/v2/search?q=terminus-plugin+quick-commands

{
  "total": 1,
  "results": [
    {
      "package": {
        "name": "terminus-quick-cmds",
        "scope": "unscoped",
        "version": "1.0.1",
        "description": "Quick commands manager for Terminus",
        "keywords": [
          "terminus-plugin",
          "quick-commands"
        ],
        "date": "2018-09-17T07:59:07.543Z",
        "links": {
          "npm": "https://www.npmjs.com/package/terminus-quick-cmds"
        },
        "author": {
          "name": "Domain"
        },
        "publisher": {
          "username": "do.main",
          "email": "do.main@msn.com"
        },
        "maintainers": [
          {
            "username": "do.main",
            "email": "do.main@msn.com"
          }
        ]
      },
      "score": {
        "final": 0.13650543158323328,
        "detail": {
          "quality": 0.4550181052774443,
          "popularity": 0,
          "maintenance": 0
        }
      },
      "searchScore": 1.5561754e-14
    }
  ]
}

But the latest version is v1.1.0: https://www.npmjs.com/package/terminus-quick-cmds