Code Snippet

Just another Code Snippet site

[How-to] NPM / Angular

Trust self-signed registry certificate :

npm config set strict-ssl false


Generate NPM Token for .npmrc file:

curl -k -H "Accept: application/json" -H "Content-Type:application/json" -X PUT --data '{"name": "<USERNAME>", "password": "<PASSWORD>"}' <NPM_REPOSITORY_URL>/-/user/org.couchdb.user:<USERNAME>


Sample .npmrc file:

@myPackage:registry=https://myrepo.com/nexus/repository/npm-private
registry=https://myrepo.com/nexus/repository/npm-public


//myrepo.com/nexus/repository/npm-public:_authToken=NpmToken.11111-1111-1111-1111-111111
//myrepo.com/nexus/repository/npm-private:_authToken=NpmToken.22222-2222-2222-2222-222222

cache=/opt/app/npm/cache
strict-ssl=false
always-auth=true

,


Leave a Reply

Your email address will not be published. Required fields are marked *