Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorForrest L Norvell <forrest@npmjs.com>2015-02-13 15:39:34 +0300
committerForrest L Norvell <forrest@npmjs.com>2015-02-13 15:39:34 +0300
commitc8e08e6d91f4016c80f572aac5a2080df0f78098 (patch)
tree3ed5feaaf6ca024606cfb668989e5911128123dc /doc
parent3ae967ed296651999de5a7b97970c490235e22bf (diff)
src: warn that peerDependency behavior is changing
...and also document it.
Diffstat (limited to 'doc')
-rw-r--r--doc/files/package.json.md12
1 files changed, 9 insertions, 3 deletions
diff --git a/doc/files/package.json.md b/doc/files/package.json.md
index 5814c3922..3f29a8c35 100644
--- a/doc/files/package.json.md
+++ b/doc/files/package.json.md
@@ -464,13 +464,19 @@ For example:
}
This ensures your package `tea-latte` can be installed *along* with the second
-major version of the host package `tea` only. The host package is automatically
-installed if needed. `npm install tea-latte` could possibly yield the following
-dependency graph:
+major version of the host package `tea` only. `npm install tea-latte` could
+possibly yield the following dependency graph:
├── tea-latte@1.3.5
└── tea@2.2.0
+**NOTE: npm versions 1 and 2 will automatically install `peerDependencies` if
+they are not explicitly depended upon higher in the dependency tree. In the
+next major version of npm (npm@3), this will no longer be the case. You will
+receive a warning that the peerDependency is not installed instead.** The
+behavior in npms 1 & 2 was frequently confusing and could easily put you into
+dependency hell, a situation that npm is designed to avoid as much as possible.
+
Trying to install another plugin with a conflicting requirement will cause an
error. For this reason, make sure your plugin requirement is as broad as
possible, and not to lock it down to specific patch versions.