Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Node.js to version 20 #7782

Merged
merged 2 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .versions
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit message nit:

Use the LTS version

Maybe say "current LTS version" as the LTS version changes over time.

NPM_VERSION=10.1.0
NUGET_INSPECTOR_VERSION=0.9.12
PHP_VERSION=8.1
PIPTOOL_VERSION=22.2.2
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile-legacy
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
11 changes: 6 additions & 5 deletions plugins/package-managers/node/src/funTest/kotlin/NpmFunTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
}
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/package-managers/node/src/main/kotlin/Npm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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<File>) = mapDefinitionFilesForNpm(definitionFiles).toList()

Expand Down
Loading