2013-05-07 18 views
19

में URL निर्भरता त्रुटि मैं एक निर्भरता package.json में है कि एक निजी पैकेज का एक Git यूआरएल मैं लिखने के सेट करना चाहते हैं:NPM स्थापित: Git package.json

"dependencies" : { 
    "mymodule" : "git://[email protected]:/myproject#mybranch" 
} 

जब npm install चल मैं इस त्रुटि मिलती है :

git clone git://[email protected]:/myproject.git Cloning into bare repository '/hom 
/Ostro/.npm/_git-remotes/git-git-myrepo-com-myproject-git-4d838f3d'... 
npm ERR! git clone git://git.myrepo.com:/myproject.git 
npm ERR! git clone git://git.myrepo.com:/myproject.git fatal: Unable to look up 
git.myrepo.com (port) (Servname() not supported for ai_socktype) 
npm ERR! Error: git "clone" "--mirror" "git://git.myrepo.com:/myproject.git" "/hom 
/Ostro/.npm/_git-remotes/git-git-myrepo-com-myproject-git-4d838f3d" failed with 128 
npm ERR! at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/exec.js:56:20) 
npm ERR! at ChildProcess.EventEmitter.emit (events.js:99:17) 
npm ERR! at maybeClose (child_process.js:638:16) 
npm ERR! at Socket.ChildProcess.spawn.stdin (child_process.js:815:11) 
npm ERR! at Socket.EventEmitter.emit (events.js:96:17) 
npm ERR! at Socket._destroy.destroyed (net.js:358:10) 
npm ERR! at process.startup.processNextTick.process._tickCallback (node.js:245:9) 

लेकिन यह NPM कॉल की तरह लग रहा git clone --mirror git://git.myrepo.com ...etc यह बजाय git clone --mirror git.myrepo.com ...etc कॉल करने के लिए लगता है कि नहीं करता है?

क्या कोई पहले से ही इसका सामना कर रहा है? या कोई सुराग है?

+0

आपके 'package.json' में गिट यूआरएल antipattern है! – hellboy

उत्तर

41

मान्य फॉर्म नीचे दिए गए हैं। यदि आप उपयोगकर्ता नाम @ का उपयोग कर रहे हैं, तो आपको या तो एसएसएच या https निर्दिष्ट करना होगा। साथ ही, मुझे यकीन नहीं है कि: यदि आप किसी खाते का उपयोग नहीं कर रहे हैं तो मान्य है।

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 
+0

thx यह समस्या को ठीक करता है – Ostro

+0

यदि आप एक निजी आरईपीओ का उपयोग करते हैं, तो बस इसे उसी पैटर्न के साथ कनेक्ट करें: उदाहरण के लिए, मैंने एक एनपीएम मॉड्यूल फोर्क किया और एक निजी गिट रेपो में एक निजी एटलेसियन स्टैश सर्वर पर धक्का दिया ... मेरी निर्भरता थी निम्नलिखित: "क्राफ्टिटी": "गिट + https: //repos.xxx.com/scm/project-a/isp-npm-module-loggin.git#HEAD" –

संबंधित मुद्दे