Node.js Lerna使用jenkins管道发布

Node.js Lerna使用jenkins管道发布,node.js,jenkins,npm,jenkins-pipeline,lerna,Node.js,Jenkins,Npm,Jenkins Pipeline,Lerna,我一直在经历一场噩梦,那就是试图让lerna在我的ci管道中发布 我已经设法从git中提取脚本来检查标记,并且找到了管道插件。因为我使用lerna发布多个包,所以我必须将插件在工作区中创建的.npmrc文件移动到主目录的根目录,以便所有包都可以访问它 NPM插件使用jenkins配置文件创建.npmrc文件。看起来是这样的: //registry.npmjs.com/:_authToken=TOKEN 这是我在詹金斯管道里的东西 stage('lerna publish') { ste

我一直在经历一场噩梦,那就是试图让lerna在我的ci管道中发布

我已经设法从git中提取脚本来检查标记,并且找到了管道插件。因为我使用
lerna
发布多个包,所以我必须将插件在工作区中创建的
.npmrc
文件移动到主目录的根目录,以便所有包都可以访问它

NPM插件使用jenkins配置文件创建
.npmrc
文件。看起来是这样的:

//registry.npmjs.com/:_authToken=TOKEN
这是我在詹金斯管道里的东西

stage('lerna publish') {
    steps {
        withCredentials([sshUserPrivateKey(credentialsId: 'cb8acd82-3a50-4a94-9d5f-44b04856e6fd', keyFileVariable: 'GITHUB_KEY')]) {
            sh 'echo ssh -i $GITHUB_KEY -l git -o StrictHostKeyChecking=no \\"\\$@\\" > ./run_ssh.sh'
            sh 'chmod +x ./run_ssh.sh'
            withEnv(['GIT_SSH=./run_ssh.sh']) {
                withNPM(npmrcConfig: 'da4e5199-b04b-41b6-a03f-dfbcc344f701') {
                    sh "rm -rf ~/.npmrc"
                    sh 'mv ./.npmrc ~/.npmrc'
                    sh 'npm config set registry https://registry.npmjs.com/'
                    sh 'git config --global user.email "thomas@reggi.com"'
                    sh 'git config --global user.name "reggi"'
                    sh 'git checkout master'
                    sh 'git pull origin master --force'
                    sh 'npm run lerna-publish'
                }
            }
        }
    }
}
以下是错误:

lerna info auto-confirmed 
lerna info publish Publishing packages to npm...
lerna ERR! npm publish --ignore-scripts exited 1 in '@reggi/help.filter-until'
lerna ERR! npm publish --ignore-scripts stderr:
npm notice 
npm notice package: @reggi/help.filter-until@0.0.20
npm notice === Tarball Contents === 
npm notice 1.5kB package.json  
npm notice 609B  index.build.js
npm notice === Tarball Details === 
npm notice name:          @reggi/help.filter-until                
npm notice version:       0.0.20                                  
npm notice package size:  997 B                                   
npm notice unpacked size: 2.1 kB                                  
npm notice shasum:        a6db6d4dc02f05548c22fe2e034832ac02252633
npm notice integrity:     sha512-6oAFaXqZMREsh[...]GnMcnIxXUBINg==
npm notice total files:   2                                       
npm notice 
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
我发现我与上面的URL不一致,并将它们都更改为
.com
,现在我遇到了这个问题:

lerna info auto-confirmed 
lerna info publish Publishing packages to npm...
lerna ERR! npm publish --ignore-scripts exited 1 in '@reggi/help.filter-until'
lerna ERR! npm publish --ignore-scripts stderr:
npm notice 
npm notice package: @reggi/help.filter-until@0.0.23
npm notice === Tarball Contents === 
npm notice 1.5kB package.json  
npm notice 609B  index.build.js
npm notice === Tarball Details === 
npm notice name:          @reggi/help.filter-until                
npm notice version:       0.0.23                                  
npm notice package size:  1.0 kB                                  
npm notice unpacked size: 2.1 kB                                  
npm notice shasum:        60ee325b219abdae06a75cfe45bc66096f715187
npm notice integrity:     sha512-o4ahyOWAsUk3j[...]O/3MH2Tpv1tOQ==
npm notice total files:   2                                       
npm notice 
npm ERR! publish Failed PUT 404
npm ERR! code E404
npm ERR! 404 Not found : @reggi/help.filter-until
npm ERR! 404 
npm ERR! 404  '@reggi/help.filter-until' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

我使用
.org
域设置令牌,并将注册表设置为
.com
域:(