繁体   English   中英

NPM 2安装了错误的Deps版本

[英]Wrong deps version installed by NPM 2

react-bootstrap@0.26.4依赖于react@^0.13.3,但react@0.14.3被安装为依赖项。 它还在node_modules的顶层安装了react@0.13.3(这很奇怪,但是很好)。 0.14.3版本破坏了我的应用程序。

我希望只安装react@0.13.3而不是在顶层,而是在node_modules / react-bootstrap / node_modules / react中安装

为什么我会收到react@0.14.3?

我也曾尝试在peerDependencies中添加react@0.13.3,但仍然得到0.14.3。 我也尝试使用npm 3,但是为使用npm 3构建的应用执行干净的npm install需要75分钟,因此我希望有一种方法可以使用npm 2安装react-bootstrap。

kullervo: ~/tmp
$ mkdir test-react-bootstrap

kullervo: ~/tmp
$ cd test-react-bootstrap

kullervo: ~/tmp/test-react-bootstrap
$ npm install react-bootstrap@0.26.4
npm WARN peerDependencies The peer dependency react@^0.13 included from react-bootstrap will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency react@>=0.11.0 included from uncontrollable will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency react@>=0.13.0 included from react-overlays will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
react@0.13.3 node_modules/react
└── envify@3.4.0 (through@2.3.8, jstransform@10.1.0)

react-bootstrap@0.26.4 node_modules/react-bootstrap
├── classnames@2.2.1
├── keycode@2.1.0
├── dom-helpers@2.4.0
├── lodash-compat@3.10.1
├── react-prop-types@0.3.0 (warning@2.1.0)
├── babel-runtime@5.8.34 (core-js@1.2.6)
├── react@0.14.3 (envify@3.4.0, fbjs@0.3.2)
├── react-overlays@0.4.4 (react-prop-types@0.2.2, warning@2.1.0)
└── uncontrollable@3.2.0 (invariant@2.2.0)

kullervo: ~/tmp/test-react-bootstrap
$ grep version node_modules/react-bootstrap/package.json | head -n 1
  "version": "0.26.4",

kullervo: ~/tmp/test-react-bootstrap
$ grep version node_modules/react-bootstrap/node_modules/react/package.json | head -n 1
  "version": "0.14.3",

kullervo: ~/tmp/test-react-bootstrap
$ grep version node_modules/react/package.json | head -n 1
  "version": "0.13.3",

kullervo: ~/tmp/test-react-bootstrap
$ node -v
v0.12.9

kullervo: ~/tmp/test-react-bootstrap
$ npm -v
2.14.9

看起来npm 2简直就是破烂。 通过升级我所有应用程序的部门,我能够使用最新版本的node和npm,突然之间性能变得不错。 案件结案。 获得的经验:不要使用npm 2。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM