jenkinsci / npm-yarn-wrapper-steps-plugin

A Jenkins plugin for convenient usage of npm and yarn in pipelines
https://plugins.jenkins.io/npm-yarn-wrapper-steps/
MIT License
2 stars 3 forks source link

error when publishing yarn 2 project #10

Closed heunghingwan closed 3 years ago

heunghingwan commented 3 years ago

Version report

Jenkins and plugins versions report:

Jenkins: 2.303.2
OS: Linux - 3.10.0-1160.42.2.el7.x86_64
---
ace-editor:1.1
ant:1.12
antisamy-markup-formatter:2.1
apache-httpcomponents-client-4-api:4.5.13-1.0
authentication-tokens:1.4
blueocean:1.25.0
blueocean-autofavorite:1.2.4
blueocean-bitbucket-pipeline:1.25.0
blueocean-commons:1.25.0
blueocean-config:1.25.0
blueocean-core-js:1.25.0
blueocean-dashboard:1.25.0
blueocean-display-url:2.4.1
blueocean-events:1.25.0
blueocean-git-pipeline:1.25.0
blueocean-github-pipeline:1.25.0
blueocean-i18n:1.25.0
blueocean-jira:1.25.0
blueocean-jwt:1.25.0
blueocean-personalization:1.25.0
blueocean-pipeline-api-impl:1.25.0
blueocean-pipeline-editor:1.25.0
blueocean-pipeline-scm-api:1.25.0
blueocean-rest:1.25.0
blueocean-rest-impl:1.25.0
blueocean-web:1.25.0
bootstrap4-api:4.6.0-3
bootstrap5-api:5.1.1-1
bouncycastle-api:2.25
branch-api:2.7.0
build-timeout:1.20
caffeine-api:2.9.2-29.v717aac953ff3
checks-api:1.7.2
cloudbees-bitbucket-branch-source:2.9.11
cloudbees-folder:6.16
command-launcher:1.6
credentials:2.6.1
credentials-binding:1.27
display-url-api:2.3.5
docker-commons:1.17
docker-java-api:3.1.5.2
docker-plugin:1.2.3
docker-workflow:1.26
durable-task:1.39
echarts-api:5.2.1-2
email-ext:2.83
favorite:2.3.3
font-awesome-api:5.15.4-1
generic-webhook-trigger:1.77
git:4.9.0
git-changelog:3.12
git-client:3.10.0
git-server:1.10
gitee:1.2.7
github:1.34.1
github-api:1.133
github-branch-source:2.11.3
gradle:1.37.1
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-1.0
htmlpublisher:1.26
http_request:1.11
jackson2-api:2.13.0-226.v0c5dd2d2fd2a
jdk-tool:1.5
jenkins-design-language:1.25.0
jira:3.6
jjwt-api:0.11.2-9.c8b45b8bb173
jquery-detached:1.2.1
jquery3-api:3.6.0-2
jsch:0.1.55.2
junit:1.53
kubernetes-cli:1.10.3
kubernetes-client-api:5.4.1
kubernetes-credentials:0.9.0
ldap:2.7
lockable-resources:2.11
mailer:1.34
mapdb-api:1.0.9.0
matrix-auth:2.6.8
matrix-project:1.19
mercurial:2.15
momentjs:1.1.1
npm-yarn-wrapper-steps:0.1.0
okhttp-api:3.14.9
pam-auth:1.6
pipeline-build-step:2.15
pipeline-github-lib:1.0
pipeline-graph-analysis:1.11
pipeline-input-step:2.12
pipeline-milestone-step:1.3.2
pipeline-model-api:1.9.2
pipeline-model-definition:1.9.2
pipeline-model-extensions:1.9.2
pipeline-rest-api:2.19
pipeline-stage-step:2.5
pipeline-stage-tags-metadata:1.9.2
pipeline-stage-view:2.19
pipeline-utility-steps:2.10.0
plain-credentials:1.7
plugin-util-api:2.5.0
popper-api:1.16.1-2
popper2-api:2.10.2-1
pubsub-light:1.16
resource-disposer:0.16
scm-api:2.6.5
script-security:1.78
snakeyaml-api:1.29.1
sse-gateway:1.24
ssh-agent:1.23
ssh-credentials:1.19
ssh-slaves:1.33.0
sshd:3.1.0
structs:1.23
subversion:2.14.5
timestamper:1.13
token-macro:266.v44a80cf277fd
trilead-api:1.0.13
variant:1.4
workflow-aggregator:2.6
workflow-api:2.47
workflow-basic-steps:2.24
workflow-cps:2.94
workflow-cps-global-lib:2.21
workflow-durable-task-step:2.39
workflow-job:2.42
workflow-multibranch:2.26
workflow-scm-step:2.13
workflow-step-api:2.24
workflow-support:3.8
ws-cleanup:0.39
CentOS Linux release 7.9.2009 (Core)

Reproduction steps

when publish a yarn 2 project, registry settings not set correctly, may be need to use different settings name?

Results

Expected result:

Actual result:

[Pipeline] {
[Pipeline] withNPMWrapper
v16.11.1 is already installed.
Now using node v16.11.1 (npm v8.0.0)
v16.11.1 is already installed.
Now using node v16.11.1 (npm v8.0.0)
v16.11.1 is already installed.
Now using node v16.11.1 (npm v8.0.0)
v16.11.1 is already installed.
Now using node v16.11.1 (npm v8.0.0)
v16.11.1 is already installed.
Now using node v16.11.1 (npm v8.0.0)
Usage Error: Couldn't find a configuration settings named "registry"

$ yarn config set [--json] [-H,--home] <name> <value>
[Pipeline] // withNPMWrapper
[Pipeline] }
jameslafferty commented 3 years ago

When I developed this plugin, it was geared toward a work project where we were using yarn classic. I'm thinking it's likely that setting npmRegistryServer instead of registry when the yarn version >= 2.. would fix your issue. I'll look at implementing a fix.

jameslafferty commented 3 years ago

@heunghingwan this should build ok after 0.3.0. Please let me know if you continue to have issues and I'll do my best to fix them!