zed-industries/zed · error · anyhow::Error
Cannot start default prettier due to its installation failur
Error message
Cannot start default prettier due to its installation failure: {e:#} What it means
The background task installing the default (Zed-managed global) prettier finished with an error. The store reacts by clearing installation_task and incrementing the attempts counter, then bails with the full error chain ({e:#}) - so the text after the colon carries the actual cause (missing node, spawn failure, network error, permissions).
Source
Thrown at crates/project/src/prettier_store.rs:351
match installation_task {
ControlFlow::Continue(None) => {
anyhow::bail!("Default prettier is not installed and cannot be started")
}
ControlFlow::Continue(Some(installation_task)) => {
log::info!("Waiting for default prettier to install");
if let Err(e) = installation_task.await {
prettier_store.update(cx, |project, _| {
if let PrettierInstallation::NotInstalled {
installation_task,
attempts,
..
} = &mut project.default_prettier.prettier
{
*installation_task = None;
*attempts += 1;
}
})?;
anyhow::bail!(
"Cannot start default prettier due to its installation failure: {e:#}"
);
}
let new_default_prettier =
prettier_store.update(cx, |prettier_store, cx| {
let new_default_prettier = Self::start_prettier(
node,
default_prettier_dir().clone(),
worktree_id,
cx,
);
prettier_store.default_prettier.prettier =
PrettierInstallation::Installed(PrettierInstance {
attempt: 0,
prettier: Some(new_default_prettier.clone()),
});
new_default_prettier
})?;View on GitHub (pinned to f4178619ac)
Solutions
- Read the chained message after the colon - it names the real failure
- Install Node.js/npm and confirm node -v and npm -v run in Zed's environment
- Check network/proxy reachability of registry.npmjs.org, then restart Zed to retry the install
- Sidestep the global install entirely with a project-local prettier: npm i -D prettier
Example fix
# before $ node -v zsh: command not found: node # after (install node, restart Zed, re-trigger format) $ node -v v22.14.0
Defensive patterns
Strategy: retry
Validate before calling
$ node -v && npm -v # both must succeed before prettier auto-install can work
Try / catch
match start_default_prettier(node, worktree_id, cx).await {
Err(e) if e.to_string().contains("installation failure") => {
// inspect {e:#} chain, fix node/npm/network, then restart Zed to retry
Err(e)
}
other => other,
} Prevention
- Keep node and npm installed and reachable in Zed's launch environment
- Use project-local prettier to avoid the global auto-install path entirely
- The store clears the failed task, so a restart after fixing the root cause re-attempts cleanly
When it happens
Trigger: installation_task.await returns Err - npm or node not on PATH, no network access to registry.npmjs.org, or a write failure in the global prettier directory - followed by an attempt to start the default prettier server.
Common situations: No Node.js installed; corporate proxy blocking the npm registry; first format in a new project on a locked-down machine.
Related errors
- Default prettier is not installed and cannot be started
- GitHub Copilot native language server binary was not install
- Failed to install or start judge proxy (exit {result.return_
- copilot was not started because of an error: {error}
- unsupported Copilot language server platform: {platform}
AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20).
Data as JSON: /api/errors/8c3f492d41a804ee.
Report an issue: GitHub.