{"record":{"id":"934d0d03be901edb","repo":"risingwavelabs/risingwave","slug":"pnpm-failed-with-status","errorCode":null,"errorMessage":"pnpm {} failed with status: {}","messagePattern":"pnpm (.+?) failed with status: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/meta/dashboard/build.rs","lineNumber":54,"sourceCode":"    Path::new(&out_dir).join(\"assets\")\n}\n\nfn build() -> anyhow::Result<()> {\n    // TODO(bugen): we should include all files and subdirectories under `DASHBOARD_DIR`\n    // while excluding the `out` directory. There's no elegant way to do this.\n    rerun_if_changed!(format!(\"{DASHBOARD_DIR}/components\"));\n\n    for args in [\n        [\"install\", \"--frozen-lockfile\"].as_slice(),\n        [\"run\", \"build\"].as_slice(),\n    ] {\n        let exit_status = Command::new(\"pnpm\")\n            .args(args)\n            .current_dir(DASHBOARD_DIR)\n            .status()?;\n\n        if !exit_status.success() {\n            anyhow::bail!(\n                \"pnpm {} failed with status: {}\",\n                args.join(\" \"),\n                exit_status\n            );\n        }\n    }\n\n    let dest = dest_dir();\n    let src = Path::new(DASHBOARD_DIR).join(\"out\");\n    dircpy::copy_dir(src, dest)?;\n\n    Ok(())\n}\n\nfn main() -> anyhow::Result<()> {\n    let should_build = env_var_is_true(\"ENABLE_BUILD_DASHBOARD\");\n\n    if should_build {","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/dashboard/build.rs#L36-L72","documentation":"In src/meta/dashboard/build.rs, the build script wraps `pnpm` invocations (e.g. `pnpm install`, `pnpm build`) run in the dashboard directory. If the pnpm child process exits with a non-zero status, the script bails with this anyhow error containing the pnpm arguments and exit status. It reflects a failed frontend build step, not a Rust compile error.","triggerScenarios":"Running cargo build of the risingwave_meta crate (build.rs of src/meta/dashboard) when pnpm install/build fails — e.g. pnpm not on PATH (status 127/101), network failure fetching npm packages, or a JavaScript/TypeScript error in the dashboard code.","commonSituations":"Building on a machine without pnpm installed; offline/air-gapped CI without npm registry access; node_modules corruption; incompatible Node version; dashboard source checked out with uncommitted local changes that fail to compile.","solutions":["Install pnpm (corepack enable pnpm or npm i -g pnpm) and ensure it is on PATH, then rebuild.","Run the failing command manually (`cd src/meta/dashboard && pnpm install && pnpm build`) to see the underlying pnpm error output.","Clear the dashboard state: delete node_modules and pnpm-lock drift, then `pnpm install` again.","Check Node/npm registry connectivity; set a registry mirror or proxy if the network is restricted.","Ensure the Node version meets the dashboard's engines requirement (use nvm to switch)."],"exampleFix":"// before: build fails with status 127 because pnpm is missing\n$ cargo build -p risingwave_meta\n// after: install pnpm via corepack first\n$ corepack enable && corepack prepare pnpm@latest --activate\n$ cargo build -p risingwave_meta","handlingStrategy":"try-catch","validationCode":"// In build.rs style: check tooling before invoking\nlet ok = Command::new(\"pnpm\").arg(\"--version\").status().map(|s| s.success()).unwrap_or(false);\nif !ok {\n    panic!(\"pnpm is not installed or not on PATH; run `corepack enable pnpm`\");\n}","typeGuard":null,"tryCatchPattern":"match Command::new(\"pnpm\").args(args).current_dir(DASHBOARD_DIR).status() {\n    Ok(status) if status.success() => {}\n    Ok(status) => anyhow::bail!(\"pnpm {} failed with status: {}\", args.join(\" \"), status),\n    Err(e) => anyhow::bail!(\"failed to spawn pnpm (is it installed?): {}\", e),\n}","preventionTips":["Install pnpm via corepack and pin the version in package.json's packageManager field.","Ensure CI has npm registry access or a configured mirror/proxy.","Run `pnpm install && pnpm build` manually in src/meta/dashboard when the build script fails to see the real error.","Keep Node version compatible (use .nvmrc/engines) and commit a consistent pnpm-lock.yaml."],"tags":["build","pnpm","nodejs","rust-build-script"],"backgroundTag":"command-not-found","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}