Skip to content

Commit dc23702

Browse files
committed
docs(deployment): name the npm 10 edgesOut install failure and its two remedies
npm 10 (the npm Node 22 ships) cannot install @objectstack/cli or @objectstack/plugin-auth: better-auth's optional vitest peer resolves to vitest@4.1.12, whose @vitest/browser-webdriverio peer set is incoherent. - self-hosting: the self-built runtime recipe installs under a pinned npm 11 the way docker/Dockerfile does (and with the image's pg/mysql2 drivers, so "equivalent" holds); the host install upgrades npm to 11 first. - troubleshooting: one Installation Issues entry, findable by the error text, with both remedies and when the entry can be removed. - getting-started: a short npm 10 note at both Prerequisites tables. Claude-Session: https://claude.ai/code/session_016PVjjuVPte5XEJvaQx1E4t Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1eac7ad commit dc23702

4 files changed

Lines changed: 53 additions & 1 deletion

File tree

‎content/docs/deployment/self-hosting.mdx‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,14 @@ image)? The official image is nothing more than:
168168

169169
```dockerfile title="Dockerfile (self-built runtime, equivalent)"
170170
FROM node:22-slim
171-
RUN npm install -g @objectstack/cli@17.7.0
171+
# node:22-slim ships npm 10, which fails this install with "reading 'edgesOut'"
172+
# (see Troubleshooting). Install under a pinned npm 11, deleted in the same layer.
173+
RUN npm install --prefix /tmp/os-installer-npm --no-save --no-audit --no-fund "npm@11.21.0" \
174+
&& export PATH="/tmp/os-installer-npm/node_modules/.bin:$PATH" \
175+
&& test "$(npm --version)" = "11.21.0" \
176+
&& npm install -g @objectstack/cli@17.7.0 "pg@^8.0.0" "mysql2@^3.0.0" \
177+
&& npm cache clean --force \
178+
&& rm -rf /tmp/os-installer-npm
172179

173180
WORKDIR /srv/app
174181
RUN chown node:node /srv/app
@@ -355,8 +362,14 @@ configuration-management estate already owns process supervision, or when you
355362
are debugging directly on the box. It needs Node 22+ and the CLI on a Linux
356363
host, and nothing else.
357364

365+
Install the CLI with npm 11. npm 10, the npm that Node 22 ships, fails with
366+
`Cannot read properties of null (reading 'edgesOut')`, and a global install
367+
reads no `overrides`, so upgrading npm is the only fix here
368+
([Troubleshooting](/docs/deployment/troubleshooting#cannot-read-properties-of-null-reading-edgesout-from-npm-install)).
369+
358370
```bash
359371
# On the host — no repo clone, just the CLI and your artifact
372+
npm install -g npm@11 # npm 11 needs Node 22.9+
360373
npm install -g @objectstack/cli
361374
npm install -g pg # Postgres driver is an optional peer of @objectstack/driver-sql —
362375
# install it next to the CLI, or the boot fails loudly (use mysql2 for OS_DATABASE_URL=mysql://…)

‎content/docs/deployment/troubleshooting.mdx‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,27 @@ Solutions to the most common issues encountered when working with ObjectStack.
88

99
---
1010

11+
## Installation Issues
12+
13+
### "Cannot read properties of null (reading 'edgesOut')" from npm install
14+
15+
**Symptom:** npm exits 1 with `npm error Cannot read properties of null (reading 'edgesOut')` while installing `@objectstack/cli` or `@objectstack/plugin-auth`. This includes the install step of `npm create objectstack` and `npm install -g @objectstack/cli`.
16+
17+
**Cause:** npm 10, the npm that Node 22 ships, crashes on an optional `vitest` peer in the auth library's dependency tree: the newest vitest 4 has no matching `@vitest/browser-webdriverio` release. npm 11 and pnpm install the same packages, and `npm ci` from a committed lockfile is not affected.
18+
19+
**Fix** (either one):
20+
21+
1. **Use npm 11** (it needs Node 22.9+): run `npm install -g npm@11`, then repeat the install. This is the only fix for `npm install -g`, because a global install reads no `overrides`. In a Dockerfile, install under a pinned npm 11, as the [self-built runtime recipe](/docs/deployment/self-hosting#docker-official-image--the-standard-path) does.
22+
2. **Stay on npm 10 and pin vitest** in your project's root `package.json`. Then run `npm install` again and commit the lockfile:
23+
24+
```json title="package.json"
25+
"overrides": { "vitest": "~4.0.0" }
26+
```
27+
28+
This entry, the npm 11 steps in [Self-hosting](/docs/deployment/self-hosting), and the npm 10 notes in [Getting Started](/docs/getting-started#prerequisites) and [Your First Project](/docs/getting-started/your-first-project#prerequisites) can be removed once `@vitest/browser-webdriverio` publishes the version that `npm view vitest dist-tags` lists as `V4`, and a plain npm 10 install of `@objectstack/plugin-auth` passes.
29+
30+
---
31+
1132
## Validation Errors
1233

1334
### "Invalid enum value" for field type

‎content/docs/getting-started/index.mdx‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,15 @@ Before you start, make sure you have the following installed:
169169
That's everything the standard path needs — `npx create-objectstack my-app`
170170
scaffolds a project with its own TypeScript toolchain and npm scripts.
171171

172+
<Callout type="warn">
173+
**npm 10 cannot install the CLI right now.** npm 10, the npm that Node 22 ships,
174+
fails with `Cannot read properties of null (reading 'edgesOut')`. Upgrade npm
175+
first with `npm install -g npm@11` (npm 11 needs Node 22.9+), or use pnpm.
176+
Already scaffolded? Upgrade, then run `npm install` in the project.
177+
[Troubleshooting](/docs/deployment/troubleshooting#cannot-read-properties-of-null-reading-edgesout-from-npm-install)
178+
has the other fix.
179+
</Callout>
180+
172181
<Callout type="info">
173182
**pnpm and TypeScript versions only matter for the framework monorepo.** If you
174183
clone [`objectstack-ai/objectstack`](https://github.com/objectstack-ai/objectstack)

‎content/docs/getting-started/your-first-project.mdx‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ That's all. A standalone project does **not** need pnpm, TypeScript pre-installe
2828
or a database server — the default template runs on an in-memory driver, and
2929
TypeScript comes in as a dev dependency.
3030

31+
<Callout type="warn">
32+
**npm 10 cannot install the CLI right now.** npm 10, the npm that Node 22 ships,
33+
fails with `Cannot read properties of null (reading 'edgesOut')`. Upgrade npm
34+
first with `npm install -g npm@11` (npm 11 needs Node 22.9+), or use pnpm.
35+
Already scaffolded? Upgrade, then run `npm install` in the project.
36+
[Troubleshooting](/docs/deployment/troubleshooting#cannot-read-properties-of-null-reading-edgesout-from-npm-install)
37+
has the other fix.
38+
</Callout>
39+
3140
## 1. Scaffold
3241

3342
```bash

0 commit comments

Comments
 (0)