Add Additional npm packages on Azure DevOps Feed
Asked Answered
C

1

1

I use Angular 2.4 for my project and the project contains .npmrc file that uses an internal register. Currently the build pipeline is returning this error:

No matching version found for yargs@^3.32.0. In most cases you or one of your dependencies are requesting a package version that doesn't exist.

My project is using uglify-js npm package and yargs npm package is one of its dependencies. Therefore, I have added yargs and uglify-js to package.json to see if it will make the error from Azure DevOp build go away, which it doesn't.

Here's the package.json:

{
  "name": "xxx",
  "version": "1.5.3",
  "private": true,
  "dependencies": {
    "@angular/common": "~2.4.0",
    "@angular/compiler": "~2.4.0",
    "@angular/core": "~2.4.0",
    "@angular/forms": "~2.4.0",
    "@angular/http": "~2.4.0",
    "@angular/platform-browser": "~2.4.0",
    "@angular/platform-browser-dynamic": "~2.4.0",
    "@angular/router": "~3.4.0",
    "@microsoft/1ds-analytics-web-js": "^3.1.6",
    "@microsoft/1ds-properties-js": "^3.1.6",
    "aspnet-webpack": "^1.0.29",
    "core-js": "^2.4.1",
    "hammerjs": "^2.0.8",
    "moment": "2.17.*",
    "ng2-translate": "~5.0.0",
    "ngx-infinite-scroll": "~0.8.2",
    "reflect-metadata": "^0.1.8",
    "rxjs": "~5.5.6",
    "webpack-hot-middleware": "^2.18.0",
    "zone.js": "^0.7.4"
  },
  "devDependencies": {
    "css-loader": "^0.23.1",
    "del": "^2.2.2",
    "extendify": "^1.0.0",
    "extract-text-webpack-plugin": "^1.0.1",
    "file-loader": "^0.8.5",
    "gulp": "^3.9.1",
    "jquery": "^2.2.3",
    "raw-loader": "^0.5.1",
    "style-loader": "^0.13.1",
    "ts-loader": "5.4.5",
    "tslint": "^3.8.1",
    "typescript": "4.2.4",
    "url-loader": "^0.5.7",
    "webpack": "^1.13.0",
    "yargs": "^3.32.0",
    "uglify-js": "^2.8.28"
  }
}

However, I am encountering this error in my build pipeline:

No matching version found for yargs@^3.32.0. In most cases you or one of your dependencies are requesting a package version that doesn't exist.

In my build pipeline, I have added .npmrc file with the register url, which connects to the feed. And in the feed, this yargs package does not exist. I was wondering how to add additional npm package to the feed?

Chelate answered 21/9, 2021 at 6:3 Comment(0)
P
0

Add Additional npm packages on Azure DevOps Feed

To resolve this issue, you could add the npmjs.com as Upstream sources for your feed:

Please check the document Use packages from npmjs.com:

  1. Edit your feed. Select the gear icon in the top right of the page to open feed settings.
  2. Select the Upstream sources pivot.
  3. Select Add upstream source in the CommandBar.
  4. Select Select a feed URL and select npmjs.com (https://registry.npmjs.org). If you like, customize the upstream name.
  5. Select Add.

Alternatively, you could install the package yargs by the command:

npm install yargs

or clone this project on github:

git clone http://github.com/bcoe/yargs.git

Then we could Publish an npm package from the command line.

Paunch answered 23/9, 2021 at 2:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.