简体   繁体   English

npm更新不会更新某些软件包

[英]npm update doesn't update certain packages

With recent update of React to 0.15 where they fixed excessive generation of tags, I decided to update the project. 随着最近将React更新到0.15,他们修复了过多的标签生成,我决定更新项目。

The problem is that when I did npm update , it updated to 0.14.8 and that's it. 问题是当我执行npm update ,它更新为0.14.8就是这样。 npm outdated shows: npm outdated节目:

Package       Current  Wanted        Latest  Location
history        1.17.0  1.17.0         2.1.0  history
react          0.14.8  0.14.8        15.0.1  react
react-dom      0.14.8  0.14.8        15.0.1  react-dom
react-router    1.0.3   1.0.3         2.3.0  react-router
react-select    0.9.1   0.9.1  1.0.0-beta12  react-select

My package.json looks like: 我的package.json看起来像:

"dependencies": {
    "extract-text-webpack-plugin": "^1.0.1",
    "history": "^1.17.0",
    "moment": "^2.11.0",
    "node-sass": "^3.4.2",
    "react": "^0.14.5",
    "react-dom": "^0.14.5",
    "react-recaptcha": "^2.0.1",
    "react-redux": "^4.0.6",
    "react-router": "^1.0.3",
    "react-select": "^0.9.1",
    "redux": "^3.0.5",
    "sass-loader": "^3.1.2"
  }

I tried to change versions to 0.15.0, but then I get an error: 我试图将版本更改为0.15.0,但随后出现错误:

npm ERR! notarget No compatible version found: react-dom@'>=0.15.0 <0.16.0'
npm ERR! notarget Valid install targets:
npm ERR! notarget ["0.1.0","0.14.0-beta1","0.14.0-beta2","0.14.0-beta3","0.14.0-rc1","0.14.0","0.14.1","0.14.2","0.14.3","0.14.4","0.14.5","0.14.6","0.15.0-alpha.1","0.14.7","15.0.0-rc.1","15.0.0-rc.2","0.14.8","15.0.0","15.0.1"]

I am still new with npm, so sorry if the question is stupid. 我对npm还是很陌生,如果问题很愚蠢,请您抱歉。 What is the right way to update all that packages? 更新所有软件包的正确方法是什么?

In this case npm update works as expected. 在这种情况下, npm update将按预期工作。 Latest version that satisfies caret dependency "^0.14.5" is 0.14.8. 满足脱字符号"^0.14.5"最新版本是0.14.8。 React switched to using major versions after v0.14.8 (see React blog ). v0.14.8之后,React切换为使用主要版本(请参见React blog )。 Latest stable version now is 15.x not 0.15.x, so you should update your package.json file: 现在最新的稳定版本是15.x而不是0.15.x,因此您应该更新package.json文件:

"dependencies": {
    ...
    "react": "^15.0.1",
    "react-dom": "^15.0.1",
    ...
  }

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

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