diff --git a/.versions b/.versions index ad6a30798884a..3de2f9df81c93 100644 --- a/.versions +++ b/.versions @@ -9,8 +9,8 @@ GO_DEP_VERSION=0.5.4 GO_VERSION=1.21.1 HASKELL_STACK_VERSION=2.7.5 JAVA_VERSION=17 -NODEJS_VERSION=18.17.1 -NPM_VERSION=8.15.1 +NODEJS_VERSION=20.9.0 +NPM_VERSION=10.1.0 NUGET_INSPECTOR_VERSION=0.9.12 PHP_VERSION=8.1 PIPTOOL_VERSION=22.2.2 diff --git a/Dockerfile b/Dockerfile index 16f09f6465ef9..4548c0e641084 100644 --- a/Dockerfile +++ b/Dockerfile @@ -181,8 +181,8 @@ COPY --from=pythonbuild /opt/python /opt/python FROM base AS nodejsbuild ARG BOWER_VERSION=1.8.12 -ARG NODEJS_VERSION=18.14.2 -ARG NPM_VERSION=8.15.1 +ARG NODEJS_VERSION=20.9.0 +ARG NPM_VERSION=10.1.0 ARG PNPM_VERSION=8.8.0 ARG YARN_VERSION=1.22.17 diff --git a/Dockerfile-legacy b/Dockerfile-legacy index 3f0925d0789ad..81b76be2622a2 100644 --- a/Dockerfile-legacy +++ b/Dockerfile-legacy @@ -75,7 +75,7 @@ ENV \ GO_DEP_VERSION=0.5.4 \ GO_VERSION=1.21.1 \ HASKELL_STACK_VERSION=2.7.5 \ - NPM_VERSION=8.15.1 \ + NPM_VERSION=10.1.0 \ PNPM_VERSION=8.8.0 \ PYTHON_PIPENV_VERSION=2022.9.24 \ PYTHON_POETRY_VERSION=1.6.1 \ @@ -100,7 +100,7 @@ RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/ echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee -a /etc/apt/sources.list.d/sbt.list && \ curl -ksS "https://keyserver.ubuntu.com/pks/lookup?op=get&options=mr&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | apt-key adv --import - && \ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ - echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \ add-apt-repository -y ppa:git-core/ppa && \ apt-get update && \ apt-get install -y --no-install-recommends \ diff --git a/plugins/package-managers/node/src/funTest/kotlin/NpmFunTest.kt b/plugins/package-managers/node/src/funTest/kotlin/NpmFunTest.kt index 04c7860e8684b..8efcb966ae3b1 100644 --- a/plugins/package-managers/node/src/funTest/kotlin/NpmFunTest.kt +++ b/plugins/package-managers/node/src/funTest/kotlin/NpmFunTest.kt @@ -21,9 +21,11 @@ package org.ossreviewtoolkit.plugins.packagemanagers.node import io.kotest.core.spec.style.WordSpec import io.kotest.engine.spec.tempdir +import io.kotest.inspectors.forAtLeastOne import io.kotest.matchers.collections.shouldHaveSize import io.kotest.matchers.should import io.kotest.matchers.shouldBe +import io.kotest.matchers.shouldHave import io.kotest.matchers.string.shouldContain import org.ossreviewtoolkit.analyzer.managers.create @@ -97,11 +99,10 @@ class NpmFunTest : WordSpec({ val result = create("NPM", allowDynamicVersions = true).resolveSingleProject(definitionFile) - result.issues shouldHaveSize 1 - with(result.issues.first()) { - source shouldBe "NPM" - severity shouldBe Severity.ERROR - message shouldContain "Unexpected token \"<\" (0x3C) in JSON at position 0 while parsing \"<>\"" + result.issues.forAtLeastOne { + it.source shouldBe "NPM" + it.severity shouldBe Severity.ERROR + it.message shouldContain "Unexpected token" } } diff --git a/plugins/package-managers/node/src/main/kotlin/Npm.kt b/plugins/package-managers/node/src/main/kotlin/Npm.kt index fe4b0fed3a91e..e8fbd8c2f7367 100644 --- a/plugins/package-managers/node/src/main/kotlin/Npm.kt +++ b/plugins/package-managers/node/src/main/kotlin/Npm.kt @@ -159,7 +159,7 @@ open class Npm( override fun command(workingDir: File?) = if (Os.isWindows) "npm.cmd" else "npm" - override fun getVersionRequirement(): RangesList = RangesListFactory.create("6.* - 8.*") + override fun getVersionRequirement(): RangesList = RangesListFactory.create("6.* - 10.*") override fun mapDefinitionFiles(definitionFiles: List) = mapDefinitionFilesForNpm(definitionFiles).toList()