Skip to content

Commit 2f2bf1e

Browse files
authored
Merge pull request #38 from Kikobeats/next
fix: node24 permission flag
2 parents 46fcefc + 0dda72e commit 2f2bf1e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ const createError = ({ name, message, ...props }) => {
1515
return error
1616
}
1717

18+
const [major] = process.version.slice(1).split('.').map(Number)
19+
20+
const PERMISSION_FLAG = major >= 24 ? '--permission' : '--experimental-permission'
21+
1822
const flags = ({ memory }) => {
19-
const flags = ['--disable-warning=ExperimentalWarning', '--experimental-permission']
23+
const flags = ['--disable-warning=ExperimentalWarning', PERMISSION_FLAG]
2024
if (memory) flags.push(`--max-old-space-size=${memory}`)
2125
return flags.join(' ')
2226
}

0 commit comments

Comments
 (0)