Skip to content
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
2 changes: 1 addition & 1 deletion fixtures/brats/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "hello, world",
"main": "server.js",
"engines": {
"node": "18.x"
"node": "20.x"
},
"dependencies": {
"bcrypt": "*",
Expand Down
2 changes: 1 addition & 1 deletion fixtures/https/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"engines" : {
"node" : "~>18"
"node" : "~>20"
}
}
2 changes: 1 addition & 1 deletion fixtures/vendored/binaries/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion fixtures/vendored/binaries/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"leftpad": "~0.0.1"
},
"engines": {
"node": "~>18"
"node": "~>20"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion fixtures/vendored/yarn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
},
"engines": {
"yarn": "*",
"node": "~>18"
"node": "~>20"
}
}
36 changes: 0 additions & 36 deletions manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ include_files:
- profile/newrelic-setup.sh
- profile/nodejs.sh
dependency_deprecation_dates:
- version_line: 18.x.x
name: node
date: 2025-04-30
link: https://github.com/nodejs/Release
- version_line: 20.x.x
name: node
date: 2026-04-30
Expand All @@ -45,38 +41,6 @@ dependency_deprecation_dates:
date: 2027-10-24
link: https://www.python.org/dev/peps/pep-0664/
dependencies:
- name: node
version: 18.20.7
uri: https://buildpacks.cloudfoundry.org/dependencies/node/node_18.20.7_linux_x64_cflinuxfs3_3454218f.tgz
sha256: 3454218faa6000ff415b649a35996d3ad7501d726fc30cf03b7bab92f508167c
cf_stacks:
- cflinuxfs3
source: https://nodejs.org/dist/v18.20.7/node-v18.20.7.tar.gz
source_sha256: f2f2f1ac616d8e253ed69cf0b44de7d4843c40d8a614f64c776ee59ff0047031
- name: node
version: 18.20.7
uri: https://buildpacks.cloudfoundry.org/dependencies/node/node_18.20.7_linux_x64_cflinuxfs4_cd7a6534.tgz
sha256: cd7a6534666f4bd23fa31f763b2fdc470be861f39675ca76f46ba9da329b6d78
cf_stacks:
- cflinuxfs4
source: https://nodejs.org/dist/v18.20.7/node-v18.20.7.tar.gz
source_sha256: f2f2f1ac616d8e253ed69cf0b44de7d4843c40d8a614f64c776ee59ff0047031
- name: node
version: 18.20.8
uri: https://buildpacks.cloudfoundry.org/dependencies/node/node_18.20.8_linux_x64_cflinuxfs3_9ebc5f70.tgz
sha256: 9ebc5f707d425f2e4b227c53dc04ea704cd71a2a8b64c7beb23adc3c3880ec82
cf_stacks:
- cflinuxfs3
source: https://nodejs.org/dist/v18.20.8/node-v18.20.8.tar.gz
source_sha256: ec60a6d2344ef9e1f093991ca1bb6bbe92c61c29d1762c4b99e08f87dbb91e2f
- name: node
version: 18.20.8
uri: https://buildpacks.cloudfoundry.org/dependencies/node/node_18.20.8_linux_x64_cflinuxfs4_826e3a8e.tgz
sha256: 826e3a8e94c5ee13162093f750f4b3569f96980b6ccc5818b1346a02d76f08eb
cf_stacks:
- cflinuxfs4
source: https://nodejs.org/dist/v18.20.8/node-v18.20.8.tar.gz
source_sha256: ec60a6d2344ef9e1f093991ca1bb6bbe92c61c29d1762c4b99e08f87dbb91e2f
- name: node
version: 20.19.3
uri: https://buildpacks.cloudfoundry.org/dependencies/node/node_20.19.3_linux_x64_cflinuxfs3_96fdc321.tgz
Expand Down
12 changes: 6 additions & 6 deletions src/nodejs/integration/versions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ func testVersions(platform switchblade.Platform, fixtures string) func(*testing.

context("when there is a .nvmrc file", func() {
it.Before(func() {
Expect(os.WriteFile(filepath.Join(source, ".nvmrc"), []byte("18"), 0600)).To(Succeed())
Expect(os.WriteFile(filepath.Join(source, ".nvmrc"), []byte("20"), 0600)).To(Succeed())
})

it("uses the Node version specified in the .nvmrc file", func() {
deployment, logs, err := platform.Deploy.Execute(name, source)
Expect(err).NotTo(HaveOccurred())

Expect(logs).To(ContainLines(
MatchRegexp("Installing node 18\\.\\d+\\.\\d+"),
MatchRegexp("Installing node 20\\.\\d+\\.\\d+"),
))

Eventually(deployment).Should(Serve("Hello world!"))
Expand All @@ -63,7 +63,7 @@ func testVersions(platform switchblade.Platform, fixtures string) func(*testing.
}
Expect(json.NewDecoder(response.Body).Decode(&process)).To(Succeed())

Expect(process.Version).To(MatchRegexp(`v18\.\d+\.\d+`))
Expect(process.Version).To(MatchRegexp(`v20\.\d+\.\d+`))
})
})

Expand All @@ -76,7 +76,7 @@ func testVersions(platform switchblade.Platform, fixtures string) func(*testing.
Expect(json.NewDecoder(file).Decode(&pkg)).To(Succeed())
Expect(file.Close()).To(Succeed())

pkg["engines"] = map[string]string{"node": "~>18"}
pkg["engines"] = map[string]string{"node": "~>20"}
content, err := json.Marshal(pkg)
Expect(err).NotTo(HaveOccurred())
Expect(os.WriteFile(filepath.Join(source, "package.json"), content, 0600)).To(Succeed())
Expand All @@ -87,7 +87,7 @@ func testVersions(platform switchblade.Platform, fixtures string) func(*testing.
Expect(err).NotTo(HaveOccurred())

Expect(logs).To(ContainLines(
MatchRegexp("Installing node 18\\.\\d+\\.\\d+"),
MatchRegexp("Installing node 20\\.\\d+\\.\\d+"),
))

Eventually(deployment).Should(Serve("Hello world!"))
Expand All @@ -101,7 +101,7 @@ func testVersions(platform switchblade.Platform, fixtures string) func(*testing.
}
Expect(json.NewDecoder(response.Body).Decode(&process)).To(Succeed())

Expect(process.Version).To(MatchRegexp(`v18\.\d+\.\d+`))
Expect(process.Version).To(MatchRegexp(`v20\.\d+\.\d+`))
})

context("when that version is unsupported", func() {
Expand Down
8 changes: 4 additions & 4 deletions src/nodejs/supply/supply.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ type Supplier struct {
}

var LTS = map[string]int{
"gallium": 16,
"hydrogen": 18,
"iron": 20,
"jod": 22,
}

func Run(s *Supplier) error {
Expand Down Expand Up @@ -727,7 +727,7 @@ func (s *Supplier) InstallNode() error {
}

func nodeVersionRequiresSSLEnvVars(version string) (bool, error) {
// NOTE: ensures OpenSSL CA store works with Node v18 and higher. Waiting
// NOTE: ensures OpenSSL CA store works with Node v20 and higher. Waiting
// for resolution on https://github.com/nodejs/node/issues/43560 to decide
// how to properly fix this.

Expand All @@ -736,7 +736,7 @@ func nodeVersionRequiresSSLEnvVars(version string) (bool, error) {
return false, err
}

return nodeVersion.Major() >= 18, nil
return nodeVersion.Major() >= 20, nil
}

func (s *Supplier) InstallNPM() error {
Expand Down
18 changes: 9 additions & 9 deletions src/nodejs/supply/supply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ var _ = Describe("Supply", func() {
defer os.Remove(nvmrcFile)

testCases := [][]string{
{"lts/hydrogen", "18.*.*"},
{"lts/*", "18.*.*"},
{"lts/iron", "20.*.*"},
{"lts/jod", "22.*.*"},
}

for _, testCase := range testCases {
Expand Down Expand Up @@ -435,7 +435,7 @@ var _ = Describe("Supply", func() {

Context("given valid .nvmrc", func() {
It("validate should succeed", func() {
validVersions := []string{"11.4", "node", "lts/*", "lts/hydrogen", "10", "10.1.1"}
validVersions := []string{"11.4", "node", "lts/*", "lts/iron", "10", "10.1.1"}
for _, version := range validVersions {
Expect(os.WriteFile(filepath.Join(buildDir, ".nvmrc"), []byte(version), 0777)).To(Succeed())
Expect(supplier.LoadNvmrc()).To(Succeed())
Expand Down Expand Up @@ -543,9 +543,9 @@ var _ = Describe("Supply", func() {
})
})

Context("Installing Node >=18", func() {
Context("Installing Node >=20", func() {
It("SSL_CERT_DIR env variable is set", func() {
dep := libbuildpack.Dependency{Name: "node", Version: "18.0.0"}
dep := libbuildpack.Dependency{Name: "node", Version: "20.0.0"}
mockManifest.EXPECT().DefaultVersion("node").Return(dep, nil)
mockManifest.EXPECT().AllDependencyVersions(gomock.Any())
mockInstaller.EXPECT().InstallDependency(dep, nodeDir).Do(installNode).Return(nil)
Expand All @@ -564,7 +564,7 @@ var _ = Describe("Supply", func() {
})
})

Context("Installing Node <18", func() {
Context("Installing Node <20", func() {
It("SSL_CERT_DIR env variable is not set", func() {
dep := libbuildpack.Dependency{Name: "node", Version: "16.0.0"}
mockManifest.EXPECT().DefaultVersion("node").Return(dep, nil)
Expand Down Expand Up @@ -1344,7 +1344,7 @@ var _ = Describe("Supply", func() {
})
})

Describe("CreateDefaultEnv for Node <18", func() {
Describe("CreateDefaultEnv for Node <20", func() {
BeforeEach(func() {
supplier.NodeVersion = "16.0.0"
})
Expand Down Expand Up @@ -1421,9 +1421,9 @@ export PATH=$PATH:"$HOME/bin":$NODE_PATH/.bin
})
})

Describe("CreateDefaultEnv for Node >=18", func() {
Describe("CreateDefaultEnv for Node >=20", func() {
BeforeEach(func() {
supplier.NodeVersion = "18.0.0"
supplier.NodeVersion = "20.0.0"
})

It("writes an env file for NODE_HOME", func() {
Expand Down
Loading