最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - NPM caret doesn't bring in newest minor version - Stack Overflow

programmeradmin3浏览0评论

In my package.json one of my dependencies is... "@packageXXX": "^0.7.0",

When I do a "npm outdated" I see... @packageXXX current: 0.7.0 wanted: 0.7.0 latest: 0.8.0

When I do "npm i" it doesn't install the latest minor version "0.8.0"

My understand is having the caret there is suppose to update to the latest minor version, but it doesn't. Can someone explain what I'm doing wrong?

In my package.json one of my dependencies is... "@packageXXX": "^0.7.0",

When I do a "npm outdated" I see... @packageXXX current: 0.7.0 wanted: 0.7.0 latest: 0.8.0

When I do "npm i" it doesn't install the latest minor version "0.8.0"

My understand is having the caret there is suppose to update to the latest minor version, but it doesn't. Can someone explain what I'm doing wrong?

Share Improve this question asked Apr 3, 2018 at 18:41 Carson the PowersCarson the Powers 8316 silver badges14 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 17

This is the case with 0.x.x since a leading zero indicates that the package isn't into a "stable" version yet. Until your package hits 1.x.x you'll need to do these updates manually (and be careful...your package isn't stable yet, meaning breaking changes can occur!).

https://semver.org/

Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable.

As per nodejs documentation, package ^0.7.0 -> will not be updated to 0.8.0 by npm update

^: It will only do updates that do not change the leftmost non-zero number. If you write ^0.13.0, when running npm update, it can update to 0.13.1, 0.13.2, and so on, but not to 0.14.0 or above. If you write ^1.13.0, when running npm update, it can update to 1.13.1, 1.14.0 and so on, but will not update to 2.0.0 or above.

发布评论

评论列表(0)

  1. 暂无评论