"devDependencies": {
"fw2": "^0.3.2",
"grunt": "^1.0.1",
"webpack": "^3.6.0"
},
"dependencies": {
"gulp": "^3.9.1",
"hello-else": "^1.0.0"
},
"peerDependencies": { },
"optionalDependencies": { },
"bundledDependencies": []
npm install packageName --save
{
"dependencies" :{
"foo" : "1.0.0 - 2.9999.9999", // 指定版本范围
"bar" : ">=1.0.2 <2.1.2",
"baz" : ">1.0.2 <=2.3.4",
"boo" : "2.0.1", // 指定版本
"qux" : "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0",
"asd" : "http://asdf.com/asdf.tar.gz", // 指定包地址
"til" : "~1.2", // 最近可用版本
"elf" : "~1.2.3",
"elf" : "^1.2.3", // 兼容版本
"two" : "2.x", // 2.1、2.2、...、2.9皆可用
"thr" : "*", // 任意版本
"thr2": "", // 任意版本
"lat" : "latest", // 当前最新
"dyl" : "file:../dyl", // 本地地址
"xyz" : "git+ssh://git@github.com:npm/npm.git#v1.0.27", // git 地址
"fir" : "git+ssh://git@github.com:npm/npm#semver:^5.0",
"wdy" : "git+https://isaacs@github.com/npm/npm.git",
"xxy" : "git://github.com/npm/npm.git#v1.0.27",
}
}
npm install packageName --save-dev
{ "name": "ethopia-waza",
"description": "a delightfully fruity coffee varietal",
"version": "1.2.3",
"devDependencies": {
"coffee-script": "~1.6.3"
},
"scripts": {
"prepare": "coffee -o lib/ -c src/waza.coffee"
},
"main": "lib/waza.js"
}
{
"name": "gulp-my-plugin",
"version": "0.0.1",
"peerDependencies": {
"gulp": "3.x"
}
}
npm ERR! peerinvalid The package gulp does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer gulp-cli-config@0.1.3 wants gulp@~3.1.9 npm ERR! peerinvalid Peer gulp-cli-users@0.1.4 wants gulp@~2.3.0
├── gulp-my-plugin@0.0.1 └── gulp@3.9.1
try {
var foo = require('foo')
var fooVersion = require('foo/package.json').version
} catch (er) {
foo = null
}
if ( notGoodFooVersion(fooVersion) ) {
foo = null
}
// .. then later in your program ..
if (foo) {
foo.doFooThings()
}
{
"name": "fe-weekly",
"description": "ELSE 周刊",
"version": "1.0.0",
"main": "index.js",
"devDependencies": {
"fw2": "^0.3.2",
"grunt": "^1.0.1",
"webpack": "^3.6.0"
},
"dependencies": {
"gulp": "^3.9.1",
"hello-else": "^1.0.0"
},
"bundledDependencies": [
"fw2",
"hello-else"
]
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有