|
| 1 | +# Install notes: why it can be slow and Windows workarounds |
| 2 | + |
| 3 | +## Why install can take a long time |
| 4 | + |
| 5 | +- **Heavy dependencies** — Kuzu, MCP SDK, Commander, fast-glob, Zod, and **sysml-v2-lsp** (GitHub dependency). A successful `npm install` often takes 1–2+ minutes due to network and disk work. |
| 6 | +- **Failed first run** — If the first install fails (e.g. on Windows due to the LSP postinstall), you have to fix and rerun, so total time includes the failed run and the retry. |
| 7 | +- **Two steps** — In a monorepo or when using sysmledgraph as a submodule, you may run install in the submodule, then build; both add to the total time. |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +## Issues and workarounds |
| 12 | + |
| 13 | +### 1. sysml-v2-lsp postinstall is Unix-only |
| 14 | + |
| 15 | +The LSP’s **postinstall** script uses Unix shell (e.g. `[ -f tsconfig.json ] && cd clients/vscode && npm install ...`). On **Windows** that is invalid (`[` is not a command), so **npm install can fail**. |
| 16 | + |
| 17 | +**Workaround:** Run install with scripts skipped, then build sysmledgraph (you do **not** need to build the LSP inside sysmledgraph’s `node_modules` if you use an external LSP path): |
| 18 | + |
| 19 | +```bash |
| 20 | +npm install --ignore-scripts |
| 21 | +npm run build |
| 22 | +``` |
| 23 | + |
| 24 | +Then either: |
| 25 | + |
| 26 | +- Point to a **pre-built LSP** elsewhere (recommended on Windows): set **SYSMLLSP_SERVER_PATH** to the path of your built `dist/server/server.js` (e.g. from a separate clone of sysml-v2-lsp where you ran `npm install` and `npm run build`), or |
| 27 | +- If you need the LSP inside this repo: clone or copy the full sysml-v2-lsp source (including grammar files) into `node_modules/sysml-v2-lsp` and run `npm run build` there manually. |
| 28 | + |
| 29 | +### 2. Kuzu cleanup warnings on Windows |
| 30 | + |
| 31 | +During install or uninstall, npm may report **EPERM** or “Failed to remove some directories” under `node_modules/kuzu` (long paths / nested dirs on Windows). This is **cleanup only**; the install itself usually completes. You can ignore these unless install actually fails. |
| 32 | + |
| 33 | +### 3. No LSP build in sysmledgraph’s node_modules |
| 34 | + |
| 35 | +When sysmledgraph is installed as a dependency (e.g. in `tools/sysmledgraph`), the **sysml-v2-lsp** package in `node_modules` may come from an npm tarball or a shallow clone that **does not include the grammar/source** (e.g. no `grammar/SysMLv2Lexer.g4`). In that case, building the LSP inside that copy fails (e.g. antlr-ng can’t find the grammar). |
| 36 | + |
| 37 | +**Workaround:** Do **not** rely on building the LSP inside sysmledgraph’s `node_modules`. Instead: |
| 38 | + |
| 39 | +- Build the LSP in a **separate clone** of sysml-v2-lsp (full repo with grammar), or use a pre-built LSP from another project. |
| 40 | +- Set **SYSMLLSP_SERVER_PATH** to that LSP’s `dist/server/server.js` when running the sysmledgraph CLI or MCP. |
| 41 | + |
| 42 | +--- |
| 43 | + |
| 44 | +## Summary |
| 45 | + |
| 46 | +| Issue | Platform | Workaround | |
| 47 | +|-------|----------|------------| |
| 48 | +| Install fails (postinstall script) | Windows | `npm install --ignore-scripts` then `npm run build` | |
| 49 | +| Slow install | All | Expected; use a pre-built LSP via SYSMLLSP_SERVER_PATH to avoid building in node_modules | |
| 50 | +| Kuzu EPERM / “Failed to remove” | Windows | Ignore if install completed; only cleanup failed | |
| 51 | +| LSP build fails (no grammar) | When used as dependency | Use external LSP: set SYSMLLSP_SERVER_PATH to a built `dist/server/server.js` from a full sysml-v2-lsp clone | |
0 commit comments