2016-07-06 51 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

好的非常感謝你。 –