oven-sh/bun · error · bun_install::Error
SymLinkLoop
Error message
SymLinkLoop
What it means
Installer error matching ELOOP: path resolution crossed more symbolic links than the kernel allows (40 on Linux), meaning a symlink cycle in node_modules, workspace links, or the project tree.
Source
Thrown at src/install/error.rs:11
#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)]
pub enum Error {
#[error("FileNotFound")]
FileNotFound,
#[error("AccessDenied")]
AccessDenied,
#[error("NotDir")]
NotDir,
#[error("NameTooLong")]
NameTooLong,
#[error("SymLinkLoop")]
SymLinkLoop,
#[error("SystemFdQuotaExceeded")]
SystemFdQuotaExceeded,
#[error("SystemResources")]
SystemResources,
#[error("DeviceBusy")]
DeviceBusy,
#[error("TarballHTTP400")]
TarballHTTP400,
#[error("TarballHTTP401")]
TarballHTTP401,
#[error("TarballHTTP402")]
TarballHTTP402,
#[error("TarballHTTP403")]
TarballHTTP403,
#[error("TarballHTTP404")]
TarballHTTP404,
#[error("TarballHTTP4xx")]View on GitHub (pinned to 8c5296ac45)
Solutions
- Remove the offending symlink chain (the error context names the path)
- Rebuild the tree: rm -rf node_modules && bun install
- Audit workspace package globs for cycles
- Never create symlinks inside node_modules manually
Example fix
# before node_modules/foo -> ../foo foo -> node_modules/foo # cycle # after rm foo bun install
Defensive patterns
Strategy: validation
Validate before calling
import { realpathSync } from "node:fs";
try {
realpathSync("node_modules/foo");
} catch (e) {
if ((e as NodeJS.ErrnoException).code === "ELOOP") {
console.error("symlink cycle under node_modules/foo");
process.exit(1);
}
} Prevention
- Let bun own node_modules links
- Never create mutual symlinks between project and node_modules
- Audit workspace globs for cyclic links
When it happens
Trigger: An A->B->A symlink chain inside node_modules (manual symlinks, broken workspace linking); a bin link pointing back into its own directory chain; a project-root symlink that includes itself in its subtree.
Common situations: Hand-made symlinks to share packages between projects; layouts migrated from other package managers; cyclic workspace package links; a symlink pointing at its own ancestor.
Related errors
- not implemented right
- blob.text() failed
- Your package manager doesn't seem to support bun. To use bun
- FileNotFound
- AccessDenied
AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16).
Data as JSON: /api/errors/df1e16fb3b60475d.
Report an issue: GitHub.