{"record":{"id":"df1e16fb3b60475d","repo":"oven-sh/bun","slug":"symlinkloop","errorCode":null,"errorMessage":"SymLinkLoop","messagePattern":"SymLinkLoop","errorType":"error_code","errorClass":"bun_install::Error","httpStatus":null,"severity":"error","filePath":"src/install/error.rs","lineNumber":11,"sourceCode":"#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)]\npub enum Error {\n    #[error(\"FileNotFound\")]\n    FileNotFound,\n    #[error(\"AccessDenied\")]\n    AccessDenied,\n    #[error(\"NotDir\")]\n    NotDir,\n    #[error(\"NameTooLong\")]\n    NameTooLong,\n    #[error(\"SymLinkLoop\")]\n    SymLinkLoop,\n    #[error(\"SystemFdQuotaExceeded\")]\n    SystemFdQuotaExceeded,\n    #[error(\"SystemResources\")]\n    SystemResources,\n    #[error(\"DeviceBusy\")]\n    DeviceBusy,\n    #[error(\"TarballHTTP400\")]\n    TarballHTTP400,\n    #[error(\"TarballHTTP401\")]\n    TarballHTTP401,\n    #[error(\"TarballHTTP402\")]\n    TarballHTTP402,\n    #[error(\"TarballHTTP403\")]\n    TarballHTTP403,\n    #[error(\"TarballHTTP404\")]\n    TarballHTTP404,\n    #[error(\"TarballHTTP4xx\")]","sourceCodeStart":1,"sourceCodeEnd":29,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/src/install/error.rs#L1-L29","documentation":"Sentinel variant of the install (package manager) Error enum mirroring errno ELOOP: resolving or writing a path crossed too many symbolic links (a symlink cycle in node_modules or the cache). Consumers map the variant to user-facing install error messages.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Find and break the circular symlink chain (often caused by bad postinstall scripts or manual linking)","Clear node_modules and the Bun cache, then reinstall","Check for accidentally self-referencing symlinks in the project"],"exampleFix":"# before\nnode_modules/foo -> ../foo\nfoo -> node_modules/foo   # cycle\n\n# after\nrm foo\nbun install","handlingStrategy":"validation","validationCode":"import { realpathSync } from \"node:fs\";\n\ntry {\n  realpathSync(\"node_modules/foo\");\n} catch (e) {\n  if ((e as NodeJS.ErrnoException).code === \"ELOOP\") {\n    console.error(\"symlink cycle under node_modules/foo\");\n    process.exit(1);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Let bun own node_modules links","Never create mutual symlinks between project and node_modules","Audit workspace globs for cyclic links"],"tags":["install","symlink","eloop","filesystem"],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","contentChangedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}