npm outdated does not respect caret notation of pa

2019-08-02 10:50发布

问题:

Using a package.json file with the following

"devDependencies": {
    "grunt": "^0.4.5",
    "grunt-concurrent": "^1.0.0",
    "grunt-contrib-jshint": "^0.10.0",
    "grunt-contrib-watch": "^0.6.1",
    "grunt-dev-update": "^1.1.0",
    "grunt-jasmine-node-new": "^0.3.2",
    "grunt-node-inspector": "^0.1.5",
    "grunt-nodemon": "^0.4.0",
    "grunt-npm-install": "^0.1.0"
}

I get an npm outdated output that looks like

Why is Wanted not 0.11.0? Doesn't "grunt-contrib-jshint": "^0.10.0" mean any version greater than or equal to 0.10.0 but less than 1.0.0 (>= 0.10.0 && < 1.0.0)? Using this as reference.

I'm using node v0.12.0 and npm v2.5.1.

回答1:

Because you currently have installed version 0.10.0 and it matches your version requirements. npm doesn't look for the newest versions if you have one that already fulfills the requirements.

You can execute npm update to update them to the latest version possible.