Skip to content

Commit 9755184

Browse files
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

File tree

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
"peerDependencies": {
3333
"openclaw": ">=2026.3.2"
3434
},
35+
"peerDependenciesMeta": {
36+
"openclaw": {
37+
"optional": true
38+
}
39+
},
3540
"devDependencies": {
3641
"@types/node": "^25.3.3",
3742
"commander": "^14.0.3",

0 commit comments

Comments
 (0)