| I am trying to use Jenkins to publish npm packages to a private npm repository. I use the config-file-provider plugin to create a new npm config file. Creating the config looks like this:  The credentials used in that config is a "username with password" credentials configured with the correct username/password for publishing to my repository. The publish part of my Jenkinsfile looks like:
nodejs(nodeJSInstallationName: "6.12.0", configId: "npm-publish-config") {
lerna publish --conventional-commits --yes
}
When I run the build I get the following error when it tries to publish:
need auth You need to authorize this machine using `npm adduser`
I did a little debugging. I was able to fine the file it claims to have used as it's npm config:
@myScope:registry = http://my.private.registry/
//my.private.registry/:always-auth = true
//my.private.registry/:username = jenkins
//my.private.registry/:_password = <<redacted>>
I have found no information online about the :username and :_password properties being supported by NPM. Everything I have found has said that the .npmrc config file should have an _authToken property like this:
@myScope:registry = http://my.private.registry/
//my.private.registry/:always-auth = true
//my.private.registry/:_authToken="SECRET"
What am I doing wrong? |