
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
@yarnpkg/doctor
Advanced tools
A cli tool to help package maintainers support pnp.
To check your package run:
yarn dlx @yarnpkg/doctor ./package-dir
You'll get a pretty output with all the warnings.
This rule warns when imported dependencies are not listed in a project/workspace's package.json.
Node allows you to import any package without having a version specified in your package.json. This can lead to subtle and hard to solve bugs.
For example:
Node might find a globally installed package and the project works on your machine. While other your colleagues might be missing the globally installed package or (worse) have an incompatible version installed.
Or Node might find a transitive dependency (dependency of a dependency) and use that. If you remove or upgrade that dependency and it affects the transitive dependency then it can trigger all sorts of bugs.
By making sure all dependencies are listed in the package.json pnp can make your project less brittle.
This rule warns when a package has unmet peer dependencies.
Peer dependencies are useful for allowing package authors to delegate control of a dependency's version to the package user. When used correctly they prevent version conflicts and reduce bundle sizes.
Peer dependencies must be manually added to the package user's package.json. Because they responsibility of the package user they can be overlooked.
This rule ensures that all peer dependencies are included and therefore installed for your project.
This rule warns when node_modules
appears in strings or template literals.
If a string literal includes "node_modules" else it is likely a sign that the package is doing shady things with node_modules which would likely fail under PnP.
One of the big benefits of Plug-n-Play is that it does away with node_modules
directories to achieve zero installs, increased stability and reliability. Therefore, resolutions that rely on the presence of a node_modules
folder will fail.
Aside from satisfying Plug'n'Play requirements, resolving packages using node_modules
this way is brittle and may result unpredictable packages versions and subtle bugs.
Examples of incorrect code for this rule:
var module = require("../node_modules/lodash");
Examples of correct code for this rule:
var foo = require("lodash"); // importing a module by its name
This rule disallows referencing loaders or plugins in string literals in a webpack.config.js
in a non-private package.
Ensures that third party tools (CRA, Next, Vue-cli, etc) resolve their own versions of loaders and presets.
When loaders and plugins are included as strings e.g loader: 'file-loader'
in a webpack.config.js
then Webpack will try to resolve it from the point of view of the project root.
If the webpack config is located in a dependency, as with tools such as Create-React-App, Next.js and Gatsby, then Webpack might accidentally use an different hoisted version of a plugin. This can cause various weird bugs and crashes.
The third party tool should use require.resolve('file-loader')
so that Webpack loads the plugin through an absolute path and it will use the loader/plugin it specifies in its own package.json.
Examples of incorrect code for this rule:
const webpackConfig = {
use: `ts-loader`,
};
Examples of correct code for this rule:
const webpackConfig = {
use: require.resolve(`ts-loader`),
};
This rule is a temporary measure to address this issue
This rule warns when the bundleDependencies
(or bundledDependencies
) field is used.
Visit the dedicated section on the website to learn more.
3.0.0
yup
anymore (we migrated to Typanion as part of Clipanion v3).
workspace-tools
, remove it from your .yarnrc.yml
, upgrade, then import it back.enableImmutableInstalls
will now default to true
on CI (we still recommend to explicitly use --immutable
on the CLI).
YARN_ENABLE_IMMUTABLE_INSTALLS=false
in your environment variables.initVersion
and initLicense
configuration options have been removed. initFields
should be used instead..pnp.cjs
files (instead of .pnp.js
) when using PnP, regardless of what the type
field inside the manifest is set to.$$virtual
into __virtual__
.-a
alias flag of yarn workspaces foreach
got removed; use -A,--all
instead, which is strictly the same..vscode/pnpify
) won't be cleaned up anymore.--skip-builds
flag from yarn install
got renamed into --mode=skip-build
.bstatePath
configuration option has been removed. The build state (.yarn/build-state.yml
) has been moved into the install state (.yarn/install-state.gz
)@yarnpkg/pnpify
has been refactored into 3 packages:
@yarnpkg/sdks
now contains the Editor SDKs@yarnpkg/pnpify
now contains the PnPify CLI compatibility tool that creates in-memory node_modules
@yarnpkg/nm
now contains the node_modules
tree builder and hoister@yarnpkg/plugin-node-modules
has been renamed to @yarnpkg/plugin-nm
--clipanion=definitions
commands supported by our CLIs will now expose the definitions on the entry point (rather than on .command
)structUtils.requirableIdent
got removed; use structUtils.stringifyIdent
instead, which is strictly the same.configuration.format
got removed; use formatUtils.pretty
instead, which is strictly the same, but type-safe.httpUtils.Options['json']
got removed; use httpUtils.Options['jsonResponse']
instead, which is strictly the same.PackageExtension['description']
got removed, use formatUtils.json(packageExtension, formatUtils.Type.PACKAGE_EXTENSION)
instead, which is strictly the same.Project.generateBuildStateFile
has been removed, the build state is now in Project.storedBuildState
.Project.tryWorkspaceByDescriptor
and Project.getWorkspaceByDescriptor
now match on virtual descriptors.Workspaces now get self-references even when under the node-modules
linker (just like how it already worked with the pnp
linker). This means that a workspace called foo
can now safely assume that calls to require('foo/package.json')
will always work, removing the need for absolute aliases in the majority of cases.
The node-modules linker now does its best to support the portal:
protocol. This support comes with two important limitations:
--preserve-symlinks
Node option if they wish to access their dependencies.portal:
must be hoisted outside of the portal. Failing that (for example if the portal package depends on something incompatible with the version hoisted via another package), the linker will produce an error and abandon the install.The node-modules linker can now utilize hardlinks. The new setting nmMode: classic | hardlinks-local | hardlinks-global
specifies which node_modules
strategy should be used:
classic
- standard node_modules
layout, without hardlinkshardlinks-local
- standard node_modules
layout with hardlinks inside the project onlyhardlinks-global
- standard node_modules
layout with hardlinks pointing to global content storage across all the projects using this optionnode-modules
linker will now ensure that the generated install layouts are terminal, by doing several rounds when needed.node-modules
linker will no longer print warnings about postinstall scripts when a workspace depends on another workspace listing install scripts.${ENV_VAR}
syntax.preinstall
, install
, postinstall
fail, the remaining scripts will be skipped.git:
protocol will now default to fetching HEAD
(rather than the hardcoded master
).SIGTERM
signal will now be propagated to child processes.yarn config unset
will now correctly unset non-nested propertiesinitFields
edge cases have been fixed.preferAggregateCacheInfo
flag will now also aggregate cleanup reports.enableMessageNames
flag can be set to false
to exclude the YNxxxx
from the output.yarn init
can now be run even from within existing projects (will create missing files).yarn init
and yarn set version
will set the packageManager
field.yarn set version
now downloads binaries from the official Yarn website (rather than GitHub).yarn set version from sources
will now upgrade the builtin plugins as well unless --skip-plugins
is set.yarn version apply
now supports a new --prerelease
flag which replaces how prereleases were previously handled.yarn run
should be significantly faster to boot on large projects.yarn workspaces foreach --verbose
will now print when processes start and end, even if they don't have an output.yarn workspaces foreach
now supports a --from <glob>
flag, which when combined with -R
will target workspaces reachable from the 'from' glob.yarn patch-commit
can now be used as many times as you want on the same patch folder.yarn patch-commit
now supports a new -s,--save
flag which will save the patch instead of just printing it.yarn up
now supports a new -R,--recursive
flag which will upgrade the specified package, regardless where it is.yarn config unset
is a new command that will remove a setting from the local configuration (or home if -H
is set).yarn exec
got support for running shell scripts using Yarn's portable shell.yarn plugin import
can now install specific versions of the official plugins.yarn plugin import
will now download plugins compatible with the current CLI by default.yarn unlink
has been added which removes resolutions previously set by yarn link
.yarn install
inside a Yarn v1 project will now automatically enable the node-modules
linker. This should solve most of the problems people have had in their migrations. We still recommend to keep the default PnP for new projects, but the choice is yours.bigint
, and fstat
.@yarnpkg/esbuild-plugin-pnp
. We use it to bundle Yarn itself!exports
field - regardless of the Node version.node:
protocol (new in Node 16)plugins
configuration property.FAQs
Unknown package
The npm package @yarnpkg/doctor receives a total of 8,031 weekly downloads. As such, @yarnpkg/doctor popularity was classified as popular.
We found that @yarnpkg/doctor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.