2016-07-06 27 views

回答

3

想到了一些事情。如果它有一个,你可以将依赖关系指向GitHub仓库。

{ 
    "name": "my-project-name", 
    "version": "0.0.1", 
    "description": "My Description Here", 
    "main": "main.js", 
    "scripts": { 
    "test": "echo \"Error: no test specified\" && exit 1" 
    }, 
    "author": "The Best Developer Ever", 
    "license": "MIT", 
    "dependencies": { 
    "express" : "github:expressjs/express", 
    "anyRepo" : "github:userName/projectName" 
    } 
} 

您还可以在您的package.json文件中进行自定义命令。说它也许酿造(这是从实际的命令行工具不同),你可以运行你的脚本,有

{ 
    "name": "my-project-name", 
    "version": "0.0.1", 
    "description": "My Description Here", 
    "main": "main.js", 
    "scripts": { 
    "brew" : "sudo brew install package-name(s)-here", 
    "any-name-here" : "echo Any command can go here" 
    }, 
    "author": "The Best Developer Ever", 
    "license": "MIT", 
    "dependencies": { 
    "express" : "github:expressjs/express", 
    } 
} 

那么您可以运行后

npm run brew

而且该命令内的任何脚本都将运行(也称为安装自制软件依赖项)。我相信这应该是你正在寻找的东西。

- 胡安

编辑 ------------------------------------ -------------------------------------------------- -------------------------------

对不起,我不小心给了错误的命令。你应该运行npm run brew不是npm brew

+0

好的非常感谢你。 –