{"record":{"id":"f71234e0e3654964","repo":"yarnpkg/yarn","slug":"unsure-how-to-copy-this-src","errorCode":null,"errorMessage":"unsure how to copy this: ${src}","messagePattern":"unsure how to copy this: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/util/fs.js","lineNumber":318,"sourceCode":"            if (--remaining === 0) {\n              onDone();\n            }\n          },\n          src: path.join(src, file),\n        });\n      }\n    } else if (srcStat.isFile()) {\n      onFresh();\n      actions.file.push({\n        src,\n        dest,\n        atime: srcStat.atime,\n        mtime: srcStat.mtime,\n        mode: srcStat.mode,\n      });\n      onDone();\n    } else {\n      throw new Error(`unsure how to copy this: ${src}`);\n    }\n  }\n}\n\nasync function buildActionsForHardlink(\n  queue: CopyQueue,\n  events: CopyOptions,\n  possibleExtraneous: Set<string>,\n  reporter: Reporter,\n): Promise<CopyActions> {\n  const artifactFiles: Set<string> = new Set(events.artifactFiles || []);\n  const files: Set<string> = new Set();\n\n  // initialise events\n  for (const item of queue) {\n    const onDone = item.onDone || noop;\n    item.onDone = () => {\n      events.onProgress(item.dest);","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/yarnpkg/yarn/blob/c2dda503f3759b5be5f0e24ecd9cf5c97a540147/src/util/fs.js#L300-L336","documentation":"Error \"unsure how to copy this: ${src}\" thrown in yarnpkg/yarn.","triggerScenarios":"Yarn tries to copy a file system entry in src/util/fs.js that is neither a regular file, directory, nor symlink (e.g. a socket, FIFO, or device file).","commonSituations":"Occurs during package extraction or cache population when a tarball or package directory contains exotic file types Yarn cannot copy.","solutions":["Remove or replace the special file (symlink, socket, FIFO, or device) at the reported path inside the package being copied, then run yarn again.","If the entry is an unexpected symlink in the package cache, run `yarn cache clean` and reinstall.","If the file belongs to a dependency you control, exclude it from the published package (via .npmignore or the files field) so it is not copied during install."],"exampleFix":"rm <socket-or-device-file> && yarn install --force","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c2dda503f3759b5be5f0e24ecd9cf5c97a540147","analyzedAt":"2026-08-13T04:17:06.305Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}