Check that your package.json dependencies have the exact same version that another dependency also present in your package.json
Check that your package.json dependencies specifically satisfies the range passed in config
Check that your package.json dependencies specifically satisfies the range set in another dependencies
Check versions in a dependency Also useable to check if a dependency is not present
Internal
getInternal
isInternal
parsedInternal
pkgOptional
author?: PersonOptional
bin?: string | Partial<Record<string, string>>The executable files that should be installed into the PATH
.
Optional
browser?: string | Partial<Record<string, string | false>>A hint to JavaScript bundlers or component tools when packaging modules for client side use.
Optional
bugs?: BugsLocationThe URL to the package's issue tracker and/or the email address to which issues should be reported.
Optional
bundledDependencies?: string[]Package names that are bundled when the package is published.
Optional
bundleDependencies?: string[]Alias of bundledDependencies
.
Optional
config?: JsonObjectIs used to set configuration parameters used in package scripts that persist across upgrades.
Optional
contributors?: Person[]A list of people who contributed to the package.
Optional
cpu?: LiteralUnion<CPU architectures the module runs on.
Optional
dependencies?: Partial<Record<string, string>> & Record<string, string>The dependencies of the package.
Optional
description?: stringPackage description, listed in npm search
.
Optional
devDependencies?: Partial<Record<string, string>> & Record<string, string>Additional tooling dependencies that are not required for the package to work. Usually test, build, or documentation tooling.
Optional
directories?: DirectoryLocationsIndicates the structure of the package.
Optional
engines?: { [key: string]: undefined | string }Engines that this package runs on.
Optional
engineStrict?: booleanOptional
esnext?: A module ID with untranspiled code that is the primary entry point to the program.
Optional
exports?: ExportsSubpath exports to define entry points of the package.
Optional
files?: string[]The files included in the package.
Optional
flat?: booleanIf your package only allows one version of a given dependency, and you’d like to enforce the same behavior as yarn install --flat
on the command-line, set this to true
.
Note that if your package.json
contains "flat": true
and other packages depend on yours (e.g. you are building a library rather than an app), those other packages will also need "flat": true
in their package.json
or be installed with yarn install --flat
on the command-line.
Optional
funding?: Describes and notifies consumers of a package's monetary support information.
Optional
homepage?: LiteralUnion<".", string>The URL to the package's homepage.
Optional
imports?: ImportsSubpath imports to define internal package import maps that only apply to import specifiers from within the package itself.
Optional
jspm?: PackageJsonJSPM configuration.
Optional
keywords?: string[]Keywords associated with package, listed in npm search
.
Optional
license?: stringThe license for the package.
Optional
licenses?: { type?: string; url?: string }[]The licenses for the package.
Optional
main?: stringThe module ID that is the primary entry point to the program.
Optional
maintainers?: Person[]A list of people who maintain the package.
Optional
man?: string | string[]Filenames to put in place for the man
program to find.
Optional
module?: stringAn ECMAScript module ID that is the primary entry point to the program.
The name of the package.
Optional
optionalDependencies?: Partial<Record<string, string>> & Record<string, string>Dependencies that are skipped if they fail to install.
Optional
os?: LiteralUnion<Operating systems the module runs on.
Optional
packageManager?: stringDefines which package manager is expected to be used when working on the current project. It can set to any of the supported package managers, and will ensure that your teams use the exact same package manager versions without having to install anything else than Node.js.
This field is currently experimental and needs to be opted-in; check the Corepack page for details about the procedure.
Optional
peerDependencies?: Partial<Record<string, string>> & Record<string, string>Dependencies that will usually be required by the package user directly or via another dependency.
Optional
peerDependenciesMeta?: Partial<Record<string, { optional: true }>>Indicate peer dependencies that are optional.
Optional
preferGlobal?: booleanIf set to true
, a warning will be shown if package is installed locally. Useful if the package is primarily a command-line application that should be installed globally.
Optional
private?: booleanIf set to true
, then npm will refuse to publish it.
Optional
publishConfig?: PublishConfigA set of config values that will be used at publish-time. It's especially handy to set the tag, registry or access, to ensure that a given package is not tagged with 'latest', published to the global public registry or that a scoped module is private by default.
Optional
repository?: string | { directory?: string; type: string; url: string }Location for the code repository.
Optional
resolutions?: Partial<Record<string, string>> & Record<string, string>Selective version resolutions. Allows the definition of custom package versions inside dependencies without manual edits in the yarn.lock
file.
Optional
resolutionsExplained?: Record<string, string>Optional
scripts?: ScriptsScript commands that are run at various times in the lifecycle of the package. The key is the lifecycle event, and the value is the command to run at that point.
Optional
sideEffects?: boolean | string[]Denote which files in your project are "pure" and therefore safe for Webpack to prune if unused.
Optional
type?: "module" | "commonjs"Resolution algorithm for importing ".js" files from the package's scope.
Optional
types?: stringLocation of the bundled TypeScript declaration file.
Optional
typesVersions?: Partial<Record<string, Partial<Record<string, string[]>>>>Version selection map of TypeScript.
Optional
typings?: stringLocation of the bundled TypeScript declaration file. Alias of types
.
Optional
version?: stringPackage version, parseable by node-semver
.
Optional
workspaces?: string[] | WorkspaceConfigUsed to configure npm workspaces / Yarn workspaces.
Workspaces allow you to manage multiple packages within the same repository in such a way that you only need to run your install command once in order to install all of them in a single pass.
Please note that the top-level private
property of package.json
must be set to true
in order to use workspaces.
Internal
pkgInternal
pkg
Example