-
Notifications
You must be signed in to change notification settings - Fork 1
Configuring NPM to use the CEDAR Nexus Server
CEDAR artifacts are hosted on BMIR's Nexus server.
A user called cedar that has administrative access on this server. The password is in the CEDAR password stash.
Nexus can be configured to act as a NPM repo and an NPM proxy.
Follow the instructions here to create an NPM proxy called npmjs
, a private CEDAR NPM repo called npm-cedar
and a CEDAR group called npm-cedar-all
.
After generating these create an .npmrc
file with the following content and place it in your home directory.
; .npmrc configured to use BMIR's Nexus server
;
; BMIR Nexus server has proxy called npmjs, a private repo called npm-cedar, and a group called npm-cedar-all
; Configured per: https://books.sonatype.com/nexus-book/3.0/reference/npm.html
; CEDAR NPM Group
registry=https://nexus.bmir.stanford.edu/repository/npm-cedar-all/
scope=org.metadatacenter
; base64 encoded authentication token
; To generate: echo -n 'cedar:password' | openssl base64
_auth=Y2VkYXI6Y2VkYXIybmV4dXM=
; Force auth to be used for GET requests
always-auth = true
; We don't want to put certificates in .npmrc
strict-ssl = false
; To publish a JavaScript artifact to the npm-cedar repo put the following in the project root:
;
; "publishConfig" : {
; "registry" : "https://nexus.bmir.stanford.edu/repository/npm-cedar/"
; }
; An email is required to publish npm packages
[email protected]
; This information is used when publishing
init.author.name = CEDAR
init.author.email = [email protected]
init.author.url = https://metadatacenter.org/
To reflect these settings for the CEDAR NPM registry do the following:
npm login --registry=https://nexus.bmir.stanford.edu/repository/npm-cedar/
You may first need to configure Nexus to support NPM bearer token authentication. To do this go to the
Administration->Realms
item and add npm Bearer Token Realm
.
If you want to modify and update these settings you must first log out as follows:
npm logout
To publish a JavaScript artifact to the npm-cedar
repo put the following in the package.json
file in the root of the JavasScript project:
"publishConfig" : {
"registry" : "https://nexus.bmir.stanford.edu/repository/npm-cedar/"
}
Then a standard npm publish
command should publish the artifact.