Skip to content

Commit

Permalink
chore!: bump nodejs requirement to 18
Browse files Browse the repository at this point in the history
Signed-off-by: Chawye Hsu <[email protected]>
  • Loading branch information
chawyehsu committed Jan 19, 2025
1 parent ca88b41 commit 9f6a11b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/@alterjs/saber/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"vue-app"
],
"engines": {
"node": ">=16"
"node": ">=18"
},
"scripts": {
"build": "rimraf dist && tsc",
Expand Down
4 changes: 2 additions & 2 deletions packages/@alterjs/saber/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import commands from './cli-commands'

function isSupported() {
const [major] = process.versions.node.split('.', 1).map(Number)
return major >= 16
return major >= 18
}

export function start() {
if (!isSupported()) {
log.error(
`Saber requires Node.js >= 16 to work currently, your current Node.js version is ${process.versions.node}.`,
`Saber requires Node.js >= 18 to work currently, your current Node.js version is ${process.versions.node}.`,
)
process.exit(1)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/create-saber/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"template"
],
"engines": {
"node": ">=16"
"node": ">=18"
},
"scripts": {
"build": "rimraf dist && rollup -c",
Expand Down
4 changes: 2 additions & 2 deletions packages/create-saber/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ function createSite() {
process.exit(1)
}

if (Number.parseInt(process.versions.node, 10) < 16) {
if (Number.parseInt(process.versions.node, 10) < 18) {
console.log(
`Node.js ${process.versions.node} isn't supported, you need Node.js 16 or above.`,
`Node.js ${process.versions.node} isn't supported, you need Node.js 18 or above.`,
)
process.exit(1)
}
Expand Down

0 comments on commit 9f6a11b

Please sign in to comment.