diff --git a/README.md b/README.md index 646bd772..ad55aaed 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ If you upgrade and are having trouble launching the application, you can `rm -rf ## Requirements -Srcbook requires node v22+. We highly recommend using [nvm](https://github.com/nvm-sh/nvm) to manage local node versions. +Srcbook requires node v20+. We highly recommend using [nvm](https://github.com/nvm-sh/nvm) to manage local node versions. ## Install diff --git a/packages/api/session.mts b/packages/api/session.mts index 1107d052..c08a38bf 100644 --- a/packages/api/session.mts +++ b/packages/api/session.mts @@ -325,8 +325,10 @@ async function load() { const loadedSessions = srcbookDirs .filter((entry) => entry.isDirectory()) .map(async (entry) => { + // .path -> .parentPath from node21 onwards. + const parentPath = entry.parentPath || entry.path; try { - const session = await createSession(Path.join(entry.parentPath, entry.name)); + const session = await createSession(Path.join(parentPath, entry.name)); sessions[session.id] = session; return session; } catch (e) { diff --git a/packages/api/utils.mts b/packages/api/utils.mts index afa40bde..2838dda1 100644 --- a/packages/api/utils.mts +++ b/packages/api/utils.mts @@ -21,9 +21,11 @@ export async function disk(dirname: string, ext: string) { return entry.isDirectory() || entry.name.endsWith(ext); }) .map((entry) => { + // .path -> .parentPath from node21 onwards. + const parentPath = entry.parentPath || entry.path; return { - path: Path.join(entry.parentPath, entry.name), - dirname: entry.parentPath, + path: Path.join(parentPath, entry.name), + dirname: entry.path, basename: entry.name, isDirectory: entry.isDirectory(), }; diff --git a/srcbook/README.md b/srcbook/README.md index d2139a3d..ef900b77 100644 --- a/srcbook/README.md +++ b/srcbook/README.md @@ -37,3 +37,7 @@ npm uninstall -g srcbook # Clear up srcbook files on disk rm -rf ~/.srcbook/ ``` + +## Requirements + +Srcbook requires node v20+. We highly recommend using [nvm](https://github.com/nvm-sh/nvm) to manage local node versions.