Walkthrough - Getting Started Creating Your Own npm registry
Setting up your own npm registry has never been easier. MyGet allows you to create your own public or private npm registries in just a few clicks and work with your own node modules (packages). This section will guide you through it.
Creating a new feed
Browse to MyGet.org and log in using your preferred identity provider.
Complete your new MyGet profile by providing a username and password. These are your MyGet credentials, which you'll need to authenticate against private feeds on MyGet.org. From now on, you can also use these to log in on the MyGet.org web site.
Create a new feed that will serve as a registry and select the desired security template: public, private or community
- public: everyone has read access, only feed owners/managers can write
- private: only users with explicitly granted permissions can read or write (depending on permissions)
- community: everyone can read all packages + anyone can manage the packages they pushed to the feed
(optional) Invite collaborators through the feed security settings.
Working with your NPM registry
Register the feed with the npm command line. This can be done by using the
--registryswitch on every npm command, or by editing the
.npmrc. The full feed URL can be found on the feed details page.
If you plan on using your MyGet npm feed all the time, we recommend running the following command:
npm config set registry https://www.myget.org/F/your-feed-name/npm/
If a MyGet npm feed is marked as private, it will always require authentication. To setup authentication, run the following commands:
npm login --registry=https://www.myget.org/F/your-feed-name/npm/ npm config set always-auth true
Add packages to the feed by either uploading them through the web site, referencing/mirroring them from the npm registry, or pushing them using the npm client.
On each feed, packages can be added through the web UI.
(optional) Enable package source proxy to seamlessly blend your MyGet feed with the public npm registry.
From the Package Sources tab, edit the Npmjs.org package source and enable the Make all upstream packages available in clients option. If you prefer to have the package binaries downloaded to your feed for subsequent requests, also enable the Automatically add downloaded upstream packages to the current feed (mirror) option.
Note that using these settings it's also possible to blend more than one npm registry into one. You can also push npm packages to other npm registries using MyGet
(optional) Check the licenses of the packages on your feed using the licenses tab. This will display a report of the licenses used by the packages on your npm feed.