package.json dependencies ^ 表示什么
发布于 1年前 作者 ceclinux 1854 次浏览
{
  "name": "application-name",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node app.js"
  },
  "dependencies": {
    "express": "3.4.7",
    "ejs": "*",
    "validator": "*",
    "connect-flash": "~0.1.1",
    "mongoose": "*",
    "express-partials": "~0.2.0",
    "blueimp-file-upload-node": "~2.1.0",
    "gulp": "3.5.6",
    "tiny-lr": "0.0.5",
    "gulp-livereload": "~1.2.0",
    "node-static": "~0.7.3",
    "imagemagick": "^0.1.3",
    "formidable": "^1.0.14",
    "colors": "^0.6.2",
    "gulp-nodemon": "^1.0.2"
  },
  "devDependencies": {
    "gulp-htmltidy": "0.0.1"
  }
}

我的package.jsondependencies出现了很多**^**带头的字符,官方文档也没有,不知道是什么东西。。 我用npm install后发现imagemagick下的版本还是0.1.3,感觉不是非的意思 求解释,谢谢~

7 回复

和rails配置文件好像,我猜是版本要大于caret后面的数字的意思

~应该是代表这个版本后的所有版本

@aphantee 感觉这个比较靠谱,谢谢~

收藏了, 涨知识

^1.2.3 := >=1.2.3-0 <2.0.0-0 "Compatible with 1.2.3". When using caret operators, anything from the specified version (including prerelease) will be supported up to, but not including, the next major version (or its prereleases). 1.5.1 will satisfy ^1.2.3, while 1.2.2 and 2.0.0-beta will not.

回到顶部