2012-07-27 48 views
0

我試圖在package.json文件中設置一個依賴項到遠程beanstalk存儲庫,以使它包含在項目中。來自Beanstalk的NPM自定義URL模塊

目前,它的設置,如下所示:

{ 
    "name": "SOME_NAME", 
    "version": "0.0.1", 
    "private": true, 
    "dependencies": { 
    "SOME_MODULE_NAME" : "[email protected]:/xxx.git#v0.0.1" 
    } 
} 

但是這將返回以下NPM錯誤:

npm WARN package.json [email protected] No README.md file found! 
npm http GET https://registry.npmjs.org/SOME_MODULE_NAME 
npm http 404 https://registry.npmjs.org/SOME_MODULE_NAME 
npm ERR! 404 'SOME_MODULE_NAME' is not in the npm registry. 
npm ERR! 404 You should bug the author to publish it 
npm ERR! 404 
npm ERR! 404 Note that you can also install from a 
npm ERR! 404 tarball, folder, or http url, or git url. 

似乎繞過豆莖url和回落到內全球尋找模塊回購。任何想法/建議?

我也嘗試過使用git + ssh:// style url無濟於事。

謝謝!

回答

1

請參閱 「Git URLs as Dependencies

Git urls can be of the form:

git://github.com/user/project.git#commit-ish 
git+ssh://[email protected]:project.git#commit-ish 
git+ssh://[email protected]/project.git#commit-ish 
git+http://[email protected]/project/blah.git#commit-ish 
git+https://[email protected]/project/blah.git#commit-ish 

The commit-ish can be any tag, sha, or branch which can be supplied as an argument to git checkout. The default is master.

您的網址應該是:

"git://xxx.beanstalkapp.com/xxx.git#v0.0.1"