我有Git repo,我在npm install期间克隆它,Package.json包含git url。 在win7设置上一切正常,但在Win10上我正面临这个问题, 不知道我在这里缺少什么。
Package.json:
{
"name": "main",
"version": "0.0.1",
"main": "index.html",
"devDependencies": {
"chromedriver": "^2.18.0",
"ld-gxp-tools": "git://git-mirror:9418/gxp/tools#master",
我得到的错误:
npm WARN package.json main@0.0.1 No repository field.
npm WARN `git config --get remote.origin.url` returned wrong result (git://git-mirror:9418/gxp/tools)
npm ERR! git clone git://git-mirror:9418/gxp/tools Cloning into bare repository 'C:\Users\Administrator\AppData\Roaming\npm-cache\_git-remotes\git-git-mirror-9418-gxp-tools-1dc087b5'...
npm ERR! git clone git://git-mirror:9418/gxp/tools fatal: Unable to look up git-mirror (port 9418) (No such host is known. )
npm ERR! Error: Command failed: git clone --mirror git://git- mirror:9418/gxp/tools C:\Users\Administrator\AppData\Roaming\npm-cache\_git-remotes\git-git-mirror-9418-gxp-tools-1dc087b5
npm ERR! Cloning into bare repository 'C:\Users\Administrator\AppData\Roaming\npm-cache\_git-remotes\git-git-mirror-9418-gxp-tools-1dc087b5'...
npm ERR! fatal: Unable to look up git-mirror (port 9418) (No such host is known. )
npm ERR!
npm ERR! at ChildProcess.exithandler (child_process.js:203:12)
npm ERR! at emitTwo (events.js:87:13)
npm ERR! at ChildProcess.emit (events.js:172:7)
npm ERR! at maybeClose (internal/child_process.js:818:16)
npm ERR! at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Windows_NT 10.0.10240
npm ERR! command "C:\\Jenkins\\workspace\\environment\\win32\\node\\node.exe" "C:\\Jenkins\\workspace\\environment\\win32\\node\\node_modules\\npm\\bin\\npm- cli.js" "install"
答案 0 :(得分:2)
您可以从客户端计算机解析此主机名:
git-mirror
如果没有,则git clone无法正常工作。
这条线要求:
"ld-gxp-tools": "git://git-mirror:9418/gxp/tools#master",