YN0000 - UNNAMEDThis code is used to log regular messages, mostly to align all the lines in the Yarn output. No worry! YN0001 - EXCEPTIONAn exception had be thrown by the program. This error typically should never happen (it should instead point to a different error message from this page so that it can be properly documented), so it should be considered a bug in Yarn. Feel free to open an issue or, even better, a pull request aiming to fix it. YN0002 - MISSING_PEER_DEPENDENCYA package requests a peer dependency, but one or more of its parents in the dependency tree doesn't provide it. Note that Yarn enforces peer dependencies at every level of the dependency tree. That is, if
Depending on your situation, multiple options are possible:
To understand more about this issue, check out this blog post. YN0003 - CYCLIC_DEPENDENCIESTwo packages with build scripts have cyclic dependencies. Cyclic dependencies are a can of worms. They happen when a package While cyclic dependencies may work fine in the general Javascript case (and in fact Yarn won't warn you about it in most cases), they can cause issues as soon as build scripts are involved. Indeed, in order to build a package, we first must make sure that its own dependencies have been properly built. How can we do that when two packages reference each other? Since the first one to build cannot be deduced, such patterns will cause the build scripts of every affected package to simply be ignored (and a warning emitted). There's already good documentation online explaining how to get rid of cyclic dependencies, the simplest one being to extract the shared part of your program into a third package without dependencies. So the first case we described would become YN0004 - DISABLED_BUILD_SCRIPTSA package has build scripts, but they've been disabled across the project. Build scripts can be disabled on a global basis through the use of the The safest way to downgrade the warning
into a notification is to explicitly disable build scripts for the affected packages through the use of the YN0005 - BUILD_DISABLEDA package has build scripts, but they've been disabled through its configuration. Build scripts can be disabled on a per-project basis through the use of the YN0006 - SOFT_LINK_BUILDA package has build scripts, but is linked through a soft link. For Yarn, a hard link is when a package is owned by the package manager. In these instances Yarn will typically copy packages having build scripts into a project-local cache so that multiple projects with multiple dependency trees don't use the same build artifacts. So what's the problem with so-called "soft links"? Soft links are when the package manager doesn't own the package source. An example is a workspace, or a dependency referenced through the There are a few workarounds:
YN0007 - MUST_BUILDA package must be built. This informational message occurs when Yarn wishes to let you know that a package will need to be built for the installation to complete. This usually occurs in only two cases: either the package never has been built before, or its previous build failed (returned a non-zero exit code). YN0008 - MUST_REBUILDA package must be rebuilt. This
information message occurs when Yarn wishes to let you know that a package will need to be rebuilt in order for the installation to complete. This usually occurs in a single case: when the package's dependency tree has changed. Note that this also includes its transitive dependencies, which sometimes may cause surprising rebuilds (for example, if YN0009 - BUILD_FAILEDA package build failed. This problem typically doesn't come from Yarn itself, and simply means that a package described as having build directives couldn't get built successfully. To see the actual error message, read the file linked in the report. It will contain the full output of the failing script. YN0010 - RESOLVER_NOT_FOUNDA resolver cannot be found for the given package. Resolvers are the components tasked from converting ranges ( This error is usually caused by a Yarn plugin being missing. YN0011 - FETCHER_NOT_FOUNDA fetcher cannot be found for the given package. Fetchers are the components that take references and fetch the source code from the remote location. A semver fetcher would likely fetch the packages from some registry, while a workspace fetcher would simply redirect to the location on the disk where the sources can be found. This error is usually caused by a Yarn plugin being missing. YN0012 - LINKER_NOT_FOUNDA linker cannot be found for the given package. Linkers are the components tasked from extracting the sources from the artifacts returned by the fetchers and putting them on the disk in a manner that can be understood by the target environment. The Node linker would use the Plug'n'Play strategy, while a PHP linker would use an autoload strategy instead. This error is usually caused by a Yarn plugin being missing. YN0013 - FETCH_NOT_CACHEDA package cannot be found in the cache for the given package and will be fetched from its remote location. When a package is downloaded from whatever its remote location is, Yarn stores it in a specific folder called then cache. Then, the next time this package was to be downloaded, Yarn simply check this directory and use the stored package if available. This message simply means that the package couldn't be found there. It's not a huge issue, but you probably should try to limit it as much as possible - for example by using Zero-Installs. YN0014 - YARN_IMPORT_FAILEDA lockfile couldn't be properly imported from a v1 lockfile. The v2 release contains major changes in the way Yarn is designed, and the lockfile format is one of them. In some rare cases, the data contained in the v1 lockfile aren't compatible with the ones we stored within the v2 files. When it happens, Yarn will emit this warning and resolve the package descriptor again. Only this package will be affected; all others will continue to be imported as expected. YN0015 - REMOTE_INVALIDThe remote source returned invalid data. This error is thrown by the resolvers and fetchers when the remote sources they communicate with return values that aren't consistent with what we would expect (for example because they are missing fields). YN0016 - REMOTE_NOT_FOUNDThe remote source returned valid data, but told us the package couldn't be found. This error is thrown by the resolvers and fetchers when the remote sources they communicate with inform them that the package against which have been made the request doesn't exist. This might happen if the package has been unpublished, and there's usually nothing Yarn can do. YN0017 - RESOLUTION_PACKThis error code isn't used at the moment (it used to print the number of packages that took part in each pass of the resolution algorithm, but was deemed too verbose compared to its usefulness). YN0018 - CACHE_CHECKSUM_MISMATCHThe checksum of a package from the cache doesn't match what the lockfile expects. This situation usually happens after you've modified the zip archives from your cache by editing the files it contains for debug purposes. Use one of the three following commands in order to bypass it:
YN0019 - UNUSED_CACHE_ENTRYA file from the cache has been detected unused while installing dependencies. Running YN0020 - MISSING_LOCKFILE_ENTRYA package descriptor cannot be found in the lockfile. A lot of commands (for example YN0021 - WORKSPACE_NOT_FOUNDA dependency uses a The
YN0022 - TOO_MANY_MATCHING_WORKSPACESThis error should be considered obsolete and not exist; open an issue if you have it. YN0023 - CONSTRAINTS_MISSING_DEPENDENCYOne of your workspaces should depend on a dependency but doesn't. A constraint has been put into effect that declares that the specified workspace must depend on the specified range of the specified dependency. Since it
currently doesn't, Yarn emits this error when running YN0024 - CONSTRAINTS_INCOMPATIBLE_DEPENDENCYOne of your workspaces should depend on a specific version of a dependency but doesn't. A
constraint has been put into effect that declares that the specified workspace must depend on the specified range of the specified dependency. Since it currently doesn't, Yarn emits this error when running One of your workspaces shouldn't depend on one of the dependencies it lists. A
constraint has been put into effect that declares that the specified workspace must depend on the specified range of the specified dependency. Since it currently doesn't, Yarn emits this error when running YN0026 - CONSTRAINTS_INVALID_DEPENDENCYOne of your workspaces lists an invalid dependency. A constraint has been put into effect that declares that the specified workspace probably shouldn't depend on the specified dependency in its current state. Since it currently
does, Yarn emits this error when running YN0027 - CANT_SUGGEST_RESOLUTIONSYarn cannot figure out proper range suggestions for the packages you're adding to your project. When running
YN0028 - FROZEN_LOCKFILE_EXCEPTIONYour lockfile would be modified if Yarn was to finish the install. When passing the This option is typically meant to be used on your CI and production servers, and fixing this error should simply be a matter of running YN0029 - CROSS_DRIVE_VIRTUAL_LOCALThis error code is deprecated. YN0030 - FETCH_FAILEDThis error code isn't used at the moment; we ideally want to explain why did the fetch fail rather than . YN0031 - DANGEROUS_NODE_MODULESYarn is installing packages using Plug'n'Play, but a This warning is emitted when your project is detected as
containing YN0032 - NODE_GYP_INJECTEDIn some situation Yarn might detect that
Packages omitting YN0046 - AUTOMERGE_FAILED_TO_PARSEThis error is triggered when Git conflict tokens are found within the
YN0047 - AUTOMERGE_IMMUTABLEThis error is triggered when Git conflict tokens are found within the When under this mode, Yarn isn't allowed to edit any file, not even for automatically resolving conflicts. This mode is typically used on CI to ensure that your projects are always in a correct state before being merged into the trunk. In order to solve this problem, try running YN0048 - AUTOMERGE_SUCCESSThis informational message is emitted when Git conflict tokens were
found within the YN0049 - AUTOMERGE_REQUIREDThis informational message is emitted when Git conflict tokens are found within the The automerge logic is pretty simple: it will take the lockfile from the pulled branch, modify it by adding the information from the local branch, and run YN0050 - DEPRECATED_CLI_SETTINGSThis error is triggered when passing options to a CLI command through its arguments (for example Starting from the v2, this isn't supported anymore. The reason for this is that we've consolidated all of our configuration inside a single store that can be defined from a yarnrc file. This guarantees that all your commands run inside the same environments (which previously wasn't the case depending on whether you were using Special note for Netlify users: Netlify currently automatically passes the YN0059 - INVALID_RANGE_PEER_DEPENDENCYA package requests a peer dependency, but the range provided is not a valid semver range. It is not possible to ensure the provided package meets the peer dependency request. The range must be fixed in order for the warning to go away. This will not prevent resolution, but may leave the system in an incorrect state. YN0060 - INCOMPATIBLE_PEER_DEPENDENCYA package requests a peer dependency, but its parent in the dependency tree provides a version that does not satisfy the peer dependency's range. The parent should be altered to provide a valid version or the peer dependency range updated. This will not prevent resolution, but may leave the system in an incorrect state. YN0061 - DEPRECATED_PACKAGEA package is marked as deprecated by the publisher. Avoid using it, use the alternative provided in the deprecation message instead. YN0062 - INCOMPATIBLE_OSA package is incompatible with the operating system, as reported by YN0063 - INCOMPATIBLE_CPUA package is incompatible with the CPU architecture, as reported by YN0068 - UNUSED_PACKAGE_EXTENSIONA packageExtension is detected by Yarn as being unused, which means that the selector doesn't match any of the installed packages. YN0069 - REDUNDANT_PACKAGE_EXTENSIONA packageExtension is detected by Yarn as being unneeded, which means that the selected packages have the same behavior with and without the extension. YN0071 - NM_CANT_INSTALL_EXTERNAL_SOFT_LINKAn external soft link (portal) cannot be installed, because incompatible version of a dependency exists in the parent package. This prevents portal representation for node_modules installs without a need to write files into portal's target directory, which is forbidden for security reasons. Workarounds If the ranges for conflicting dependencies overlap between portal target and portal parent, the workaround is to use YN0072 - NM_PRESERVE_SYMLINKS_REQUIREDA portal dependency with subdependencies is used in the project. YN0074 - NM_HARDLINKS_MODE_DOWNGRADED
YN0075 - PROLOG_INSTANTIATION_ERRORThis error appears when a Prolog predicate is called with an invalid signature. Specifically, it means that some of the predicate parameters are non-instantiated
(ie have no defined value), when the predicate would expect some. This doesn't mean that you need to hardcode a value, just that you need to assign one before calling the predicate. In the case of the
You would also use the
For more information about the parameters that must be instantiated when calling the predicate reported by the error message, consult the dedicated page from our documentation. YN0076 - INCOMPATIBLE_ARCHITECTUREA
package is specified in its manifest (through the YN0077 - GHOST_ARCHITECTURESome native packages may be excluded from the install if they signal they don't support the systems the project is intended for. This detection is typically based on your current system parameters, but it can be configured using the
Note that all fields from How do you start the yarn command?If you run yarn <script>[<args>] in your terminal, yarn will run a user-defined script. More on that in our tutorial on yarn run. When you run yarn <command> [<arg>] on the command line, it will run the command if it matches a locally installed CLI. So you don't have to setup user-defined scripts for simple use cases.
Why is yarn not working?To solve the error "'yarn' is not recognized as an internal or external command, operable program or batch file", install the yarn package globally by running npm install -g yarn , restart your terminal and make sure your PATH environment variable is set up correctly.
Why npm start is not working?Check the ignore-script config
If you see the start script is present inside your package. json file but still can't run the script, you need to check the console output. If there's no output at all, then you may have the ignore-scripts npm configuration set to true .
What is npm start in yarn?npm start is a shortcut for npm run start. Now in terms of running scripts from package.json , all these are equivalent: npm run start. npm start. yarn run start.
|