簡體   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