1

I'm not able to install packages from npm, since I have placed a .npmrc file for install a private library. This library is hosted by azure work space. So i just placed the new config file to install. And it works fine in localhost.

How can i keep 2 registry in nprmc file, one for private and another one of npm registry?

error 404 Not Found - GET https://registry.npmjs.org/mm-core - Not found

mm-core is my private library hosted in azure, without my .npmrc file i receive this error.

With .npmrc file npm packages can't be installed.

any help?

1 Answers1

1

It actually should work if you follow the official documents correctly. And we don't need to keep 2 registry in nprmc file, one for private and another one of npm registry.

Solution:

Keep the .npmrc file which presents the azure devops artifacts feed. And sign-in the azure devops web portal to configure the feed settings:

enter image description here

In feed settings, go Upstream sources and make sure you have npmjs as Upstream source. If it not exists, click the Add upstream source to add npmjs.

enter image description here

Then you only need to hold one registry for private library. If the package is not found in your private feed, since we've configured npmjs as upstream source, it will fetch the missing package there automatically!

More details about magic upstream source please refer to this document.

LoLance
  • 25,666
  • 1
  • 39
  • 73
  • Hello, thanks for answer. This is my current error: http://prntscr.com/rcgii2 I have the library avaliable using upstream source in Azure http://prntscr.com/rcgj32 – Juan Garcia Mar 06 '20 at 10:09
  • Sorry for the delay, but can you share more details about your [npm task](https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/package/npm?view=azure-devops)? I need to make sure how you define the task.(yaml or UI?) Please make sure you select azure devops feed as source. – LoLance Mar 10 '20 at 09:12
  • My issue currently is this. https://developercommunity.visualstudio.com/content/problem/943181/cant-npm-install-in-azure-with-pipeline-and-outsid.html – Juan Garcia Mar 10 '20 at 12:33
  • So you're using the feed from another project? Navigate to that feed=>Permissions=>Add user/groups=>Add CurrentProject build service to check if it helps. And please select `Registry I select here` instead of in my .npmrc file to check. Let me know if it helps :) – LoLance Mar 13 '20 at 09:17