user3066027
user3066027

Reputation: 327

Azure Devops: Sudden failure of NPM package download

Since 2 days a download/install (no changes to the env at all) fails in my azure devops pipeline:

npm ERR! code E404 npm ERR! 404 Not Found - GET https://pkgs.dev.azure.com/.../NPM-Mirror/npm/registry/esprima-fb/-/esprima-fb-15001.1001.0-dev-harmony-fb.tgz

  • Cannot find the package 'esprima-fb' in feed '' npm ERR! 404 npm ERR! 404 'esprima-fb@https://pkgs.dev.azure.com/.../NPM-Mirror/npm/registry/esprima-fb/-/esprima-fb-15001.1001.0-dev-harmony-fb.tgz' is not in this registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git URL.

which basically points to that package here:

https://www.npmjs.com/package/esprima-fb/v/15001.1001.0-dev-harmony-fb

The package was last changed 7 years ago and worked fine until Wednesday of this week (even the underlying source was not changed for a while).

I tried Node version 16 and 17, both have same effect.

I tried to install the package by

- task: Npm@1
  displayName: 'NPM: install'
  inputs:
    command: 'ci'
    workingDir: 'path/'

and

- task: Npm@1
  displayName: 'NPM: install'
  inputs:
    command: 'install'
    workingDir: 'path/'

none worked.

I've recognized that this version of the package is not downloaded to the Azure Artifacts Upstream Archive (only an older version is available).

Tried to recreate another Feed, also no effect. Tried to add the dependency directly into the package.json file - all showed no effect at all.

Do you have any idea how to fix that problem? I ran out of ideas.

Upvotes: 1

Views: 2020

Answers (1)

Alberto Maghini
Alberto Maghini

Reputation: 84

Azure DevOps feed for npm package sometimes throws incorrect HTTP status code when encountering authentication issue (it should be 401 instead of 404).

Typically npm install issues with Azure DevOps relies on an expired PAT token into your project's .npmrc file.

To be sure npm is always hitting npmjs.org for public packages, I'd suggest scoping your private packages (the ones coming from Azure DevOps feed) and defining the npmjs.org registry for all the others.

@[your_private_package_scope]:registry=[your_feed_url]
registry=https://registry.npmjs.org/

Upvotes: 2

Related Questions