{"record":{"id":"94b472f68ab1f4fb","repo":"parcel-bundler/parcel","slug":"a-parcel-link-could-not-be-found","errorCode":null,"errorMessage":"A Parcel link could not be found!","messagePattern":"A Parcel link could not be found!","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/parcel-link/src/unlink.js","lineNumber":164,"sourceCode":"      let appRoot = process.cwd();\n\n      let parcelLinkConfig;\n      try {\n        parcelLinkConfig = await ParcelLinkConfig.load(appRoot, {fs});\n      } catch (e) {\n        // boop!\n      }\n\n      if (parcelLinkConfig) {\n        await action(parcelLinkConfig, {\n          dryRun: options.dryRun,\n          forceInstall: options.forceInstall,\n          log,\n        });\n\n        if (!options.dryRun) await parcelLinkConfig.delete();\n      } else {\n        throw new Error('A Parcel link could not be found!');\n      }\n\n      log('🎉 Unlinking successful');\n    });\n}\n","sourceCodeStart":146,"sourceCodeEnd":170,"githubUrl":"https://github.com/parcel-bundler/parcel/blob/59484858a1a0bcbb71f74088956bb437a2db6505/packages/dev/parcel-link/src/unlink.js#L146-L170","documentation":"Thrown by the `parcel-link unlink` command when no `.parcel-link` config file is found in the current working directory (appRoot). `ParcelLinkConfig.load` is wrapped in a try/catch that swallows the error, so `parcelLinkConfig` stays undefined and the command refuses to run. The message tells you there is nothing to undo because no link was ever established here.","triggerScenarios":"Running `parcel-link unlink` (or `unlink`) in a directory where `parcel-link link` was never run, or where the `.parcel-link` file was already deleted. Also when running from the wrong directory (not the app root that contains the link).","commonSituations":"Running unlink after manually deleting `.parcel-link`; running it from a subdirectory rather than the app root; CI or a fresh clone where the link was never set up; double-running unlink (the second invocation finds nothing).","solutions":["Verify you are in the app root that was originally linked: `ls -la .parcel-link` — the file must exist.","If you already unlinked (or the file is gone), there is nothing to do; the unlink is a no-op goal and you can ignore the error.","If you are in the wrong directory, `cd` to the directory that contains `.parcel-link` and re-run `parcel-link unlink`.","If you want to unlink a stale link whose config file was lost, manually restore node_modules with `yarn install --force` (or your package manager equivalent)."],"exampleFix":"// before (wrong cwd)\n$ cd packages/app/src && parcel-link unlink\n// after\n$ cd /path/to/app-root\n$ parcel-link unlink","handlingStrategy":"validation","validationCode":"import fs from 'fs';\nfunction canUnlink(appRoot) {\n  return fs.existsSync(`${appRoot}/.parcel-link`);\n}\nif (!canUnlink(process.cwd())) {\n  console.error('No .parcel-link in cwd — nothing to unlink.');\n  process.exit(0);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always run parcel-link unlink from the same directory you ran link in.","Treat the absence of `.parcel-link` as a successful no-op rather than an error in CI.","Keep link/unlink operations in scripts anchored to a known app root."],"tags":["parcel-link","config","cli","user-error"],"backgroundTag":null,"analyzedSha":"59484858a1a0bcbb71f74088956bb437a2db6505","analyzedAt":"2026-08-13T04:06:35.925Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}