mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
fix(cli): enforce node engine version on start
This commit is contained in:
parent
fe5c8ed0fb
commit
6ed62a9a3d
4 changed files with 18 additions and 4 deletions
|
|
@ -15,7 +15,7 @@ If you are looking to import your Google Photos takeout, we recommend this commu
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- Node.js 20 or above
|
- Node.js 22 or above
|
||||||
- Npm
|
- Npm
|
||||||
|
|
||||||
If you can't install node/npm, there is also a Docker version available below.
|
If you can't install node/npm, there is also a Docker version available below.
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,12 @@
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
import '../dist/index.js';
|
import { createRequire } from 'node:module';
|
||||||
|
import semver from 'semver';
|
||||||
|
|
||||||
|
const { engines } = createRequire(import.meta.url)('../package.json');
|
||||||
|
|
||||||
|
if (!semver.satisfies(process.version, engines.node, { includePrerelease: true })) {
|
||||||
|
console.error(`The Immich CLI requires Node.js ${engines.node}, but you are running ${process.version}.`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
await import('../dist/index.js');
|
||||||
|
|
|
||||||
|
|
@ -59,13 +59,14 @@
|
||||||
"check": "tsc --noEmit"
|
"check": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20.0.0"
|
"node": ">=22.0.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chokidar": "^4.0.3",
|
"chokidar": "^4.0.3",
|
||||||
"fast-glob": "^3.3.2",
|
"fast-glob": "^3.3.2",
|
||||||
"fastq": "^1.17.1",
|
"fastq": "^1.17.1",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"micromatch": "^4.0.8"
|
"micromatch": "^4.0.8",
|
||||||
|
"semver": "^7.8.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
3
pnpm-lock.yaml
generated
3
pnpm-lock.yaml
generated
|
|
@ -219,6 +219,9 @@ importers:
|
||||||
micromatch:
|
micromatch:
|
||||||
specifier: ^4.0.8
|
specifier: ^4.0.8
|
||||||
version: 4.0.8
|
version: 4.0.8
|
||||||
|
semver:
|
||||||
|
specifier: ^7.8.1
|
||||||
|
version: 7.8.5
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@eslint/js':
|
'@eslint/js':
|
||||||
specifier: ^10.0.0
|
specifier: ^10.0.0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue