ProGet Documentation

npm Feeds in ProGet

A ProGet npm feed is a repository compatible with the npm client for NodeJS. ProGet npm feeds support both scoped and unscoped npm packages.

npm Feed Specifics

Connectors to the public repository at npmjs.org will not include scoped packages in search results, because the public repository does not have a mechanism for including them. Scoped packages can still be used through this connector; they are only excluded from searches, and this is the same behavior seen from searching at npmjs.org directly.

The npm client does not support using Windows Integrated Authentication, so ProGet attempts to disable its usage for npm API endpoints in favor of basic HTTP authentication. However, disabling Windows Authentication on a per-URL basis does not work in every environment. If you are having trouble getting this working, you may create a second web site in IIS for ProGet with Windows Authentication disabled without acquiring a separate license.

Creating an npm Feed

Click on the Feeds tab in the navigation bar, and you will see a list of feeds in the system.

Click on the Create New Feed button and select npm.

Supply a value for the Feed name field. This will be the name of your private npm registry, and should contain characters that can be easily typed in a URL. For instance, you could use private-npm.

Click the Create Feed button, and you should be automatically directed to the newly-created registry.

If your ProGet server has access to the Internet, you should see a listing of packages from npmjs.org. These are called connector packages, and are not hosted on your ProGet instance, but are transparently proxied from another server. After you create the npm feed, you can add a connector for npmjs.org directly within your feed or by clicking on the Connectors tab at the top of the page. This way you can have access to that rich library of packages in addition to your private ones. Connectors also allow filtering, if you would like to include only a subset of external packages; however, no filtering is performed by default. For more information about connectors, see the documentation.

Setting up npm

First, you will need to tell npm where to look for its registry; by default it will be configured for npmjs.org. Use the following command, substituting proget for the name name/port of your ProGet server, and private-npm for the name of the npm feed you created above.

          [~]$ npm config set registry http://proget/npm/private-npm
      

Publishing a Package

You can also publish packages to ProGet using npm. First, use the adduser command to log in as ProGet's default Admin account, and when prompted for a password, use the same one that you used to log in to ProGet (default is Admin).

          [~]$ npm adduser
[~]$ npm publish package.tgz

Caching, Privileges, and More

With connectors, you don't need to switch your client to a different registry; ProGet will aggregate all of them for you. You may want to explore some additional features such as:

  • Caching - Feeds are created with caching enabled by default; that is, whenever a connector package is first downloaded, ProGet will save a copy that will be used later instead. For large packages, this can save time if you have a slow connection to the Internet.
  • Privileges - ProGet has granular task-based privileges that can be scoped to a particular feed. If your organization utilizes Active Directory/LDAP, you may be interested in ProGet Enterprise, which lets you use those credentials with ProGet.