yarn
Yarn Error Codes
Error codes emitted by Yarn Berry (v2 and later). They appear prefixed with YN followed by a four-digit number in Yarn's structured log output.
18 codes
references yarnpkg.com/advanced/error-codes
· All codes 18 codes
- YN0000 Unnamed Generic log output with no specific category. Used for informational messages and progress reports that don't map to a more specific code.
- YN0001 Exception Yarn itself threw an uncaught JavaScript exception. This is typically a bug in Yarn; the full stack trace is printed. Report it to the Yarn issue tracker.
- YN0002 Missing Peer Dependency A peer dependency is declared by a package but is not installed in the project. Install the missing peer dependency or add it to peerDependenciesMeta with optional: true if it is not required.
- YN0006 Will Resolve to Wrong Version A workspace: protocol range cannot resolve to the workspace package and will fall back to an external registry version. This usually indicates a version mismatch between the workspace's version field and the range used to depend on it.
- YN0007 Must Build A package has a build script (postinstall, prepare, etc.) that must be executed. Yarn will run the script after installation.
- YN0009 Build Failed A package's build script (postinstall, prepare, or similar) exited with a non-zero status code. Check the build output for the specific error. You can skip builds with enableScripts: false or via the dependenciesMeta configuration.
- YN0013 Fetch Not Cached A package was not found in the local cache and had to be fetched from the network. In offline mode (--immutable with no cache) this becomes a fatal error.
- YN0016 Remote Not Found The registry or remote URL returned a 404 or similar response. The package may not exist, the package name may be misspelled, or the scope may require authentication.
- YN0018 Cache Checksum Mismatch The checksum of a cached package file does not match the value recorded in the lockfile. Delete the cache entry or run yarn cache clean and reinstall to fetch a fresh copy.
- YN0020 Missing Lockfile Entry A package is referenced in node_modules or a descriptor but has no corresponding entry in yarn.lock. Run yarn install to regenerate the lockfile.
- YN0021 Workspace Not Found A workspace: protocol reference points to a workspace package that does not exist in the project. Check the spelling of the workspace name and ensure it is listed in the root workspaces field.
- YN0028 Incompatible Node.js Version A package's engines.node field specifies a version range that does not match the currently running Node.js version. Update Node.js or add the package to the ignoredBuiltinErrors configuration.
- YN0035 Package Not Found The requested package could not be found in the registry. Verify the package name, check that the registry URL is correct, and ensure any required authentication is configured.
- YN0046 Automerge Ambiguity Yarn cannot automatically determine the correct value to use when resolving a conflict in the lockfile. Resolve the conflict manually and re-run yarn install.
- YN0047 Automerge Required The lockfile has unresolved merge conflicts. Run yarn install to let Yarn automatically merge them, or resolve them manually.
- YN0050 Incompatible OS A package's os field in package.json lists operating systems that do not include the current platform. The package will be skipped on this OS.
- YN0060 Incompatible CPU A package's cpu field in package.json does not include the current CPU architecture. The package will be skipped on this architecture.
- YN0062 Incompatible libc A package's libc field in package.json specifies a C library (glibc or musl) that does not match the current system's libc. The package will be skipped on this system.