javascript - 在 "devDependencies"和 "peerDependencies"中指定 node.js 依赖

标签 javascript node.js gruntjs dependencies

我刚刚在 grunt-contrib-clean package.json 文件中发现,它对 grunt 有依赖性,这在两个部分中都有说明:devDependencies peerDependencies, https://github.com/gruntjs/grunt-contrib-clean/blob/master/package.json#L25-L34 :

  "devDependencies": {
    "grunt": "^0.4.5",
    "grunt-cli": "^0.1.13",
    "grunt-contrib-internal": "^0.4.10",
    "grunt-contrib-jshint": "^0.11.0",
    "grunt-contrib-nodeunit": "^0.4.1"
  },
  "peerDependencies": {
    "grunt": ">=0.4.0"
  },

这有意义吗?特别是,有不同的版本说明?这是一个未被注意到的错误吗?

编辑:还发布了一个 github issue .

最佳答案

所以根据; https://github.com/gruntjs/grunt-contrib-clean/issues/67 :

Read up on the difference of devDependencies and peerDependencies. The devDep >is for the actual grunt dep we use for testing and the peerDep is for noting >which grunt version the plugin works with. Both resolve to the same version.

关于javascript - 在 "devDependencies"和 "peerDependencies"中指定 node.js 依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29067071/

相关文章:

javascript - HTML5 自定义视频控件

javascript - 当需要匹配多个元素时,可以替代 $ ("#id .class") 语法吗?

node.js - 带有 url 数组的 Elasticsearch 术语

javascript - "restClient is not defined"虽然它实际上是

gruntjs - NPM,Bower,Browserify,Gulp,Grunt,Webpack

javascript - jQuery 定位与 CSS3 "transform: scale"

javascript - jquery 在查找或过滤之前返回到元素

javascript - Express JS 从 AJAX 请求中获取 URL

node.js - grunt-contrib-copy 因不允许 EPERM 操作而死亡 "C:\Documents and Settings"

gruntjs - Grunt cssmin 缩小后的 CSS 为空