2013-05-07 16 views
19

voglio impostare una dipendenza che è un URL Git di un pacchetto privato in package.json scrivo:NPM installare: Git errore di dipendenza URL nel package.json

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

Quando si esegue npm install ottengo questo errore :

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) 

Ma sembra chiamata npm git clone --mirror git://git.myrepo.com ...etc non è vero supponiamo di chiamare git clone --mirror git.myrepo.com ...etc invece?

Qualcuno lo ha già affrontato? o hai qualche idea?

+0

L'URL di Git in "pacchetto.json" è antipattern! – hellboy

risposta

41

I moduli validi sono di seguito. Se si utilizza il nome utente @, è necessario specificare ssh o https. Inoltre, non sono sicuro che:/sia valido se non si sta utilizzando un account.

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 risolve il problema – Ostro

+0

Se si utilizza un REPO privato, basta collegarlo seguendo lo stesso schema: ad esempio, ho biforcato un modulo NPM e ho spinto su un server privato di Stitch Atlessian in un repository privato di git ... La mia dipendenza era la following: "crafity": "git + https: //repos.xxx.com/scm/project-a/isp-npm-module-loggin.git#HEAD" –

Problemi correlati