openclaw - 💡(How to fix) Fix [Bug] Built-in feishu plugin setup fails: @larksuiteoapi/node-sdk not resolved in config CLI context (2026.4.22) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#71019Fetched 2026-04-25 06:08:34
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Timeline (top)
closed ×1commented ×1

Error Message

$ node -e "require('@larksuiteoapi/node-sdk')"
Error: Cannot find module '@larksuiteoapi/node-sdk'

(run from workspace dir — fails)

$ cd /opt/homebrew/lib/node_modules/openclaw && node -e "require('@larksuiteoapi/node-sdk')"

(no output — succeeds when cwd is inside the bundle)

Root Cause

Root Cause (根因分析)
The stock built-in Feishu plugin (dist/extensions/feishu/) declares @larksuiteoapi/node-sdk ^1.61.1 as a dependency. The package IS present in the OpenClaw bundle at:
/opt/homebrew/lib/node_modules/openclaw/node_modules/@larksuiteoapi/node-sdk/

Code Example

$ node -e "require('@larksuiteoapi/node-sdk')"  
Error: Cannot find module '@larksuiteoapi/node-sdk'  
# (run from workspace dir — fails)  

$ cd /opt/homebrew/lib/node_modules/openclaw && node -e "require('@larksuiteoapi/node-sdk')"  
# (no output — succeeds when cwd is inside the bundle)
RAW_BUFFERClick to expand / collapse

Description (问题描述)
When running openclaw config --section feishu to configure the built-in Feishu channel, the setup wizard fails with an error that the @larksuiteoapi/node-sdk package cannot be found in the environment. This prevents the guided setup from completing.

Steps to Reproduce (复现步骤)

  1. Run openclaw config --section feishu on OpenClaw 2026.4.22
  2. Progress through the config wizard
  3. Observe error about missing @larksuiteoapi/node-sdk

Environment (环境)

  • OpenClaw version: 2026.4.22 (00bd2cf)
  • Node.js runtime used by CLI: v25.9.0 (system default)
  • Node.js runtime used by Gateway: v22.22.2

Root Cause (根因分析)
The stock built-in Feishu plugin (dist/extensions/feishu/) declares @larksuiteoapi/node-sdk ^1.61.1 as a dependency. The package IS present in the OpenClaw bundle at:
/opt/homebrew/lib/node_modules/openclaw/node_modules/@larksuiteoapi/node-sdk/

However, the config CLI (openclaw config) spawns a Node.js process from the user's current working directory (~/.openclaw/workspace/). The system Node.js (v25) cannot resolve modules from the OpenClaw bundle's node_modules/ directory, because:

  • OpenClaw's node_modules are not in the global module search path
  • The CLI does not set NODE_PATH to include the bundle's node_modules

Verification:

$ node -e "require('@larksuiteoapi/node-sdk')"  
Error: Cannot find module '@larksuiteoapi/node-sdk'  
# (run from workspace dir — fails)  

$ cd /opt/homebrew/lib/node_modules/openclaw && node -e "require('@larksuiteoapi/node-sdk')"  
# (no output — succeeds when cwd is inside the bundle)

The built-in Feishu plugin's setup-entry.js uses defineBundledChannelSetupEntry with dynamic imports via import.meta.url, but the dynamic import also fails at CLI runtime because the module resolution context is wrong.

Suggested Fix (建议修复)
Option A: Have the CLI setup entry set NODE_PATH or require('module').globalPaths to include the openclaw bundle's node_modules before loading the setup plugin.

Option B: Bundle the required SDK with the CLI entry point itself rather than relying on the plugin's node_modules.

Option C: Use import() with an explicit absolute path to the bundled module rather than relying on Node module resolution.

Logs / Screenshots (日志/截图)

  • Plugin exists: /opt/homebrew/lib/node_modules/openclaw/dist/extensions/feishu/
  • SDK exists: /opt/homebrew/lib/node_modules/openclaw/node_modules/@larksuiteoapi/node-sdk/ (v1.61.1)
  • CLI node version: v25.9.0
  • Gateway node version: v22.22.2
  • openclaw plugins list shows feishu plugin (community) alongside the built-in stock feishu

extent analysis

TL;DR

Set NODE_PATH to include the OpenClaw bundle's node_modules directory to resolve the missing @larksuiteoapi/node-sdk package issue.

Guidance

  • Verify the @larksuiteoapi/node-sdk package is present in the OpenClaw bundle at /opt/homebrew/lib/node_modules/openclaw/node_modules/@larksuiteoapi/node-sdk/.
  • Set NODE_PATH to include the OpenClaw bundle's node_modules directory before running the openclaw config --section feishu command.
  • Consider using an absolute path with import() to load the bundled module instead of relying on Node module resolution.
  • Review the suggested fixes (Option A, B, or C) and choose the most suitable approach for the project.

Example

export NODE_PATH=$NODE_PATH:/opt/homebrew/lib/node_modules/openclaw/node_modules
openclaw config --section feishu

Notes

The issue is specific to the openclaw config command and the Feishu plugin. The suggested fixes may have implications for other plugins or dependencies.

Recommendation

Apply workaround by setting NODE_PATH to include the OpenClaw bundle's node_modules directory, as this is a straightforward and non-invasive solution.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING