jfrog / jenkins-artifactory-plugin

Jenkins artifactory plugin
http://jenkins-ci.org/
114 stars 186 forks source link

NodeJS 18 build issue #815

Closed kirill-a closed 1 year ago

kirill-a commented 1 year ago

After switching from NodeJS 16 to NodeJS 18 npmTool in our pipeline configuration we are getting ENV_INVALID_AUTH error when the pipeline tries to run the Run Artifactory npm ci. The groovy code is as follows:

def artServer = ArtifactoryHelper.getServer(Artifactory, artifactoryServerId, artifactoryCredentialsId)
rtNpm = Artifactory.newNpmBuild()
rtNpm.resolver server: artServer, repo: artifactoryRepository
rtNpm.tool = 'NodeJS 18'
buildInfo = rtNpm.ci path: npmPackageDirectory

error log:

21:14:50  Executing command: /bin/sh -c git log --pretty=format:%s -1
21:14:55  May 23, 2023 1:14:55 PM org.jfrog.build.extractor.packageManager.PackageManagerLogger info
21:14:55  INFO: Executing command: /bin/sh -c npm ci
21:14:56  May 23, 2023 1:14:56 PM org.jfrog.build.extractor.packageManager.PackageManagerLogger error
21:14:56  SEVERE: npm ci failed: IOException: npm ERR! code ERR_INVALID_AUTH
21:14:56  npm ERR! Invalid auth configuration found: `_auth` must be renamed to `//artifacts.com/artifactory/api/npm/:_auth` in project config
21:14:56  npm ERR! Please run `npm config fix` to repair your configuration.`
21:14:56  
21:14:56  npm ERR! A complete log of this run can be found in:
21:14:56  npm ERR!     /opt/jenkins/.npm/_logs/2023-05-23T13_14_56_266Z-debug-0.log
21:14:56  {
21:14:56    "error": {
21:14:56      "code": "ERR_INVALID_AUTH",
21:14:56      "summary": "Invalid auth configuration found: `_auth` must be renamed to `//artifacts.com/artifactory/api/npm/:_auth` in project config\nPlease run `npm config fix` to repair your configuration.`",
21:14:56      "detail": ""
21:14:56    }
21:14:56  }

Even if there's no credentials passed and .npmrc only contains 'registry = ', the plugin still throws this error.

Artifactory plugin version 3.18.3 Jenkins version 2.346.4.1-rolling

Booligoosh commented 6 months ago

Hi, any reason why this issue was closed? I'm seeing this too.

eyalbe4 commented 6 months ago

@Booligoosh, The Artifactory Jenkins Plugin doesn't support Node 18 and won't be supporting future versions of Node. Our recommendation is to switch to the next gen JFrog Jenkins Plugin, which provides support for all versions.