Hello!
I’m attempting to do an install of an npm package that is stored on a Nexus server I have setup. I’m doing the following:
name: My Test
on: [push]
jobs:
myjob:
name: My Job
runs-on: [ubuntu-18.04]
steps:
- name: Initialize npm
run: |
npm config set _auth $(echo -n $MYUSERNAMECOLONPASSWORD | openssl base64)
npm config set email my@email.com
npm config set registry https://my.nexus.domain/repository/some-group/
npm config set always-auth true
npm config set strict-ssl true
npm install --production --no-save mypackage
However, I get the dreaded “Unable to authenticate, need: BASIC realm”.
npm ERR! code E401
npm ERR! Unable to authenticate, need: BASIC realm="Sonatype Nexus Repository Manager"
I’m quite certain that my Nexus instance is not the problem as I can do the equivalent on Jenkins, Bitbucket Pipelines, and other environments.
I’d prefer NOT to use a GitHub Action tailored specifically for Nexus as I would like my workflow to be agnostic in regards to the type of npm registry provider it uses. (Maybe I’ll move to Artifactory in the future.)
Any help would be greatly appreciated.
Thanks,
Ryan