Environment
- OS: macOS 26.3.1 (Darwin 25.3.0) arm64
- lark-cli version: v1.0.2 (also reproduced on v1.0.0)
- Node.js: v25.8.2
- npm: 11.11.1
- Installation method: npm global install
- Network: Behind HTTP proxy (https_proxy=http://127.0.0.1:7897)
Description
npm install -g @larksuite/cli completes without error, but the bin/ directory is empty — the Go binary is never downloaded. The postinstall script (scripts/install.js) uses Node.js native https.get() which does not honor the https_proxy / HTTP_PROXY environment variables. In mainland China (and other regions where GitHub is slow or blocked), this causes the download to fail silently.
curl and wget in the same shell session work fine because they respect proxy environment variables.
Steps to Reproduce
-
Set an HTTP proxy:
export https_proxy=http://127.0.0.1:7897
-
Install lark-cli:
npm install -g @larksuite/cli
-
Check the binary:
ls $(npm root -g)/@larksuite/cli/bin/
# Empty directory — no binary
-
Verify curl works with the same proxy:
curl -fSL -o /tmp/lark-cli.tar.gz \
"https://github.com/larksuite/cli/releases/download/v1.0.2/lark-cli-1.0.2-darwin-arm64.tar.gz"
# Downloads successfully at ~5 MB/s
Expected Behavior
The postinstall script should download the binary successfully when a proxy is configured via standard environment variables.
Suggested Fix
Replace https.get() with curl in scripts/install.js. curl is available on macOS, Linux, and Windows 10+ (built-in), and automatically respects proxy environment variables.
// Current: Node.js https (ignores proxy)
function download(url, destPath) {
return new Promise((resolve, reject) => {
const client = url.startsWith("https") ? https : require("http");
client.get(url, (res) => { ... });
});
}
// Suggested: curl (respects proxy)
function download(url, destPath) {
return new Promise((resolve, reject) => {
try {
execSync(`curl -fSL --max-time 60 -o "${destPath}" "${url}"`, {
stdio: "inherit",
});
resolve();
} catch (e) {
reject(new Error(`curl download failed: ${url}`));
}
});
}
Alternatively, use a proxy-aware HTTP library like node-fetch with https-proxy-agent, or pass the proxy to https.get() via the agent option.
Workaround
After installation, manually run:
curl -fSL -o /tmp/lark-cli.tar.gz \
"https://github.com/larksuite/cli/releases/download/v1.0.2/lark-cli-1.0.2-darwin-arm64.tar.gz"
tar -xzf /tmp/lark-cli.tar.gz -C /tmp/
cp /tmp/lark-cli $(npm root -g)/@larksuite/cli/bin/lark-cli
chmod 755 $(npm root -g)/@larksuite/cli/bin/lark-cli
Environment
Description
npm install -g @larksuite/clicompletes without error, but thebin/directory is empty — the Go binary is never downloaded. The postinstall script (scripts/install.js) uses Node.js nativehttps.get()which does not honor thehttps_proxy/HTTP_PROXYenvironment variables. In mainland China (and other regions where GitHub is slow or blocked), this causes the download to fail silently.curlandwgetin the same shell session work fine because they respect proxy environment variables.Steps to Reproduce
Set an HTTP proxy:
export https_proxy=http://127.0.0.1:7897Install lark-cli:
Check the binary:
Verify curl works with the same proxy:
Expected Behavior
The postinstall script should download the binary successfully when a proxy is configured via standard environment variables.
Suggested Fix
Replace
https.get()withcurlinscripts/install.js.curlis available on macOS, Linux, and Windows 10+ (built-in), and automatically respects proxy environment variables.Alternatively, use a proxy-aware HTTP library like
node-fetchwithhttps-proxy-agent, or pass the proxy tohttps.get()via theagentoption.Workaround
After installation, manually run: