Commit 9755184
committed
fix(e2e): mark openclaw peer as optional to fix install on 2026.5.18
openclaw@2026.5.18 removed --omit=peer from the npm install it runs in
the plugin staging directory (see install-package-dir-CBciXqgD.js).
That makes npm 7+ auto-install peerDependencies, planting a real
node_modules/openclaw/ directory in the staging area. A new safety
check in plugin-peer-link refuses to overwrite a non-symlink directory
at the peer-link path, so the symlink never gets created and the
install fails with:
Installed plugin opik-openclaw declares openclaw as a peer dependency,
but OpenClaw could not create a plugin-local node_modules/openclaw link.
The install env explicitly sets npm_config_legacy_peer_deps=false, so
shipping a .npmrc with legacy-peer-deps=true in the tarball would not
help (env vars override .npmrc). And --ignore-scripts is hardcoded, so
postinstall cleanup hooks cannot run.
Fix: declare openclaw as an optional peer via peerDependenciesMeta.
npm 7+ honors this by NOT auto-installing optional peers, so the
phantom node_modules/openclaw never appears and the symlink step
succeeds cleanly. The peerDependencies declaration is kept so the
openclaw plugin install pipeline still recognizes openclaw as a peer
and creates the symlink at runtime (it filters on Object.keys of
peerDependencies, not on optional metadata).
Verified locally with the exact env vars openclaw 2026.5.18 sets
(legacy_peer_deps=false, strict_peer_deps=false): npm install only
creates the 119 legitimate runtime packages, no openclaw directory.
This also unblocks fresh user installs on openclaw 2026.5.18+, not
just CI.1 parent 3ad0539 commit 9755184
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| |||
0 commit comments