-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Error on incompatible node version (#1867)
* error if node too old * fixes #1678
- Loading branch information
1 parent
71df00e
commit f979e55
Showing
3 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@graphprotocol/graph-cli': patch | ||
--- | ||
|
||
error out if node is too old |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
#!/usr/bin/env node | ||
import process from 'node:process'; | ||
import semver from 'semver'; | ||
import { execute } from '@oclif/core'; | ||
import { nodeVersion } from '../dist/version.js'; | ||
|
||
if (!semver.satisfies(process.version, nodeVersion)) { | ||
process.stderr.write( | ||
`Node.js version ${nodeVersion} is required. Current version: ${process.version}\n`, | ||
); | ||
process.exit(1); | ||
} | ||
|
||
await execute({ dir: import.meta.url }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters