UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 852 B
import{n as resolveRuntimeDependencyEntrypointUrl,r as runtimeProcessDependencyEntrypoints}from"./runtime-process-dependency-url-B8551TxM.mjs";import fs from"node:fs";import{fileURLToPath}from"node:url"; //!src/infra/npm-command.ts function resolveBundledNpmCommand(e){let t=runtimeProcessDependencyEntrypoints.npm.specifier;try{const n=fileURLToPath(resolveRuntimeDependencyEntrypointUrl(`npm`,import.meta.url));t=n;if(!fs.statSync(n).isFile())throw new Error(`Not a regular file`);return[process.execPath,n,...e]}catch(e){throw Object.assign(new Error(`Bundled npm CLI is missing: ${t}. Reinstall OpenClaw to restore npm/bin/npm-cli.js.`,{cause:e}),{code:`BUNDLED_NPM_CLI_NOT_FOUND`,name:`BundledNpmCliNotFoundError`})}}function resolveNpmCommand(e){return process.versions.bun?resolveBundledNpmCommand(e):[`npm`,...e]}export{resolveNpmCommand as t};