Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Configuring NPM to use the CEDAR Nexus Server

cedaradmin edited this page Aug 15, 2017 · 21 revisions

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/reference/npm-proxying-registries.html

; CEDAR NPM Group
registry=https://nexus.bmir.stanford.edu/content/groups/npm-cedar-all/

; base64 encoded authentication token
; To generate: echo -n 'user:password' | openssl base64
_auth = <result of above command>

; Force auth to be used for GET requests
always-auth = true

; We don't want to put certificates in .npmrc
strict-ssl = false

; 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 publish a Javascript artifact to the npm-cedar repo put the following in the package.json file in the root of the Javascript project:

"publishConfig" : {
   "registry" : "https://nexus.bmir.stanford.edu/content/repositories/npm-cedar/"
}
Clone this wiki locally