试图找出peerDependencies
代表的内容......我想出了这个package.json
内容文件。它属于一个分布在那里的图书馆项目。
{
"name": "...",
"version": "...",
"description": "...",
"author": "...",
"license": "Unlicense",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"build": "typings install && tsc --outDir dist/"
},
"peerDependencies": {
"@angular/core": "^2.0.0", <<<<<<<<
"@angular/http": "^2.0.0", <<<<<<<<
"@angular/common": "^2.0.0", <<<<<<<<
"@angular/compiler": "^2.0.0", <<<<<<<<
"core-js": "^2.4.0", <<<<<<<<
"reflect-metadata": "^0.1.3", <<<<<<<<
"rxjs": "5.0.0-beta.12", <<<<<<<<
"zone.js": "^0.6.17" <<<<<<<<
},
"devDependencies": {
"@angular/core": "^2.0.0", <<<<<<<<
"@angular/http": "^2.0.0", <<<<<<<<
"@angular/common": "^2.0.0", <<<<<<<<
"@angular/compiler": "^2.0.0",
"@angular/platform-browser": "^2.0.0", <<<<<<<<
"core-js": "^2.4.0", <<<<<<<<
"reflect-metadata": "^0.1.3", <<<<<<<<
"rxjs": "5.0.0-beta.12", <<<<<<<<
"zone.js": "^0.6.17", <<<<<<<<
"typescript": "^2.0.0",
"typings": "^1.3.2"
}
}
devDependencies
和peerDependencies
dependencies
?答案 0 :(得分:1)
从下午3点开始,peerDependencies
再次为not automatically downloaded。相反,如果尚未安装依赖项,nom会发出警告。
我想象的以这种方式构造package.json
的原因是:
开发人员需要下载并安装依赖项并使用devDependencies
消费者不一定需要下载依赖项,因为它们可能已经在项目中安装了它们。但是,如果他们还没有,peerDependencies
的存在将保证他们会在安装时收到警告(他们需要手动解决)。