From a68550e57667574d81b041392f49d3d257754247 Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Sat, 16 May 2026 12:41:43 +0800 Subject: [PATCH] fix: add -Encoding ASCII to Set-Content to prevent npm auth BOM issue --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3c49042..494b92a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -68,7 +68,7 @@ pipeline { steps { withCredentials([usernamePassword(credentialsId: 'NEXUS_CREDS', passwordVariable: 'NPM_PASS', usernameVariable: 'NPM_USER')]) { bat """ - powershell -NonInteractive -Command "Set-Content .npmrc ('//nexus.xuqinmin.com/repository/npm-hosted/:_auth=' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(\$env:NPM_USER + ':' + \$env:NPM_PASS)))" + powershell -NonInteractive -Command "Set-Content .npmrc ('//nexus.xuqinmin.com/repository/npm-hosted/:_auth=' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(\$env:NPM_USER + ':' + \$env:NPM_PASS))) -Encoding ASCII" npm publish --registry %NEXUS_REGISTRY% """ }