If your organization uses GitHub or GitHub Enterprise, npm On-Site can be configured to automatically use them for login and access control. Simply add a repository field to your package.json that points to your repo:
"repository": "url": "git://github.mycompany.com/myco/mypackage.git"
npm On-Site restricts installation of your package to users who have access to the repo for that package, and restricts publishing of that package to users who have commit access to the repo.
To point npm On-Site at your GitHub Enterprise appliance:
GitHub
as the authentication strategy.GitHub Enterprise
.If you use two-factor authentication for your GitHub account, you will need to
manually generate a token and add it to your .npmrc
file.
.npmrc
file:@myco:registry=https://npme-private.npmjs.com///npme-private.npmjs.com/:_authToken=3aa689a8a6772ab997bb333d096b8c1f48a9ccc
Note: you do not need to run npm login
if you set up two-factor authentication this way.
Last modified January 19, 2016 Found a typo? Send a pull request!