在尝试安装nodegit时如何修复此gyp rebuild错误?

时间:2016-03-01 17:32:59

标签: node.js npm node-gyp npm-install nodegit

我正在尝试在Windows 7计算机上安装nodegit模块。以下是我安装的一些内容的相关版本,让我知道其他任何有用的东西:

Windows 7

python v2.7

节点v4.2.0(我切换到32位节点)

以前的行如下:

gyp ERR! stack Error: 404 status code downloading 64-bit node.lib

说(当我安装了64位节点时):

gyp ERR! stack Error: 404 status code downloading 32-bit node.lib

我想也许它试图说它找不到32位版本的节点,所以我删除了64位版本并下载了32位版本。现在它引用了引用64位节点的404错误。

我认为这可能是版本不兼容的问题,但我对节点很新,所以我很茫然。任何帮助将不胜感激,这是我尝试运行“npm install nodegit”时遇到的错误:

> nodegit@0.4.1 install C:\code\node_modules\nodegit
> node lifecycleScripts/install

    [nodegit] Fetching binary from S3.
    [nodegit] Failed to install prebuilt binary, building manually.
    [nodegit] Making sure dependencies are available and native code is generated
    [nodegit] Something is missing, retrieving dependencies and regenerating code
promisify-node@0.1.5 node_modules\promisify-node
    └── nodegit-promise@1.0.2 (asap@1.0.0)

combyne@0.8.1 node_modules\combyne

nan@1.9.0 node_modules\nan

fs-extra@0.18.4 node_modules\fs-extra
├── jsonfile@2.2.3
├── graceful-fs@3.0.8
    └── rimraf@2.5.2 (glob@7.0.0)

js-beautify@1.6.2 node_modules\js-beautify
├── config-chain@1.1.10 (ini@1.3.4, proto-list@1.2.4)
├── nopt@3.0.6 (abbrev@1.0.7)
└── mkdirp@0.5.1 (minimist@0.0.8)

mocha@2.4.5 node_modules\mocha
├── escape-string-regexp@1.0.2
├── commander@2.3.0
├── growl@1.8.1
├── diff@1.4.0
├── supports-color@1.2.0
├── debug@2.2.0 (ms@0.7.1)
├── mkdirp@0.5.1 (minimist@0.0.8)
├── glob@3.2.3 (inherits@2.0.1, graceful-fs@2.0.3, minimatch@0.2.14)
└── jade@0.26.3 (commander@0.6.1, mkdirp@0.3.0)

request@2.69.0 node_modules\request
├── aws-sign2@0.6.0
├── forever-agent@0.6.1
├── tunnel-agent@0.4.2
├── is-typedarray@1.0.0
├── oauth-sign@0.8.1
├── caseless@0.11.0
├── stringstream@0.0.5
├── isstream@0.1.2
├── json-stringify-safe@5.0.1
├── extend@3.0.0
├── tough-cookie@2.2.1
├── qs@6.0.2
├── node-uuid@1.4.7
├── mime-types@2.1.10 (mime-db@1.22.0)
├── combined-stream@1.0.5 (delayed-stream@1.0.0)
├── form-data@1.0.0-rc3 (async@1.5.2)
├── aws4@1.3.1 (lru-cache@4.0.0)
├── bl@1.0.3 (readable-stream@2.0.5)
├── hawk@3.1.3 (cryptiles@2.0.5, boom@2.10.1, sntp@1.0.9, hoek@2.16.3)
├── http-signature@1.1.1 (assert-plus@0.2.0, jsprim@1.2.2, sshpk@1.7.4)
└── har-validator@2.0.6 (pinkie-promise@2.0.0, commander@2.9.0, chalk@1.1.1, i
my-json-valid@2.13.1)

tar@2.2.1 node_modules\tar
├── inherits@2.0.1
├── block-stream@0.0.8
└── fstream@1.0.8 (graceful-fs@4.1.3, mkdirp@0.5.1, rimraf@2.5.2)

lcov-result-merger@1.0.2 node_modules\lcov-result-merger
├── vinyl@0.4.6 (clone-stats@0.0.1, clone@0.2.0)
├── through2@0.6.5 (xtend@4.0.1, readable-stream@1.0.33)
└── vinyl-fs@0.3.14 (graceful-fs@3.0.8, defaults@1.0.3, strip-bom@1.0.0, mkdir
0.5.1, glob-stream@3.1.18, glob-watcher@0.0.6)

coveralls@2.11.8 node_modules\coveralls
├── lcov-parse@0.0.6
├── log-driver@1.2.4
├── minimist@1.2.0
├── js-yaml@3.0.1 (esprima@1.0.4, argparse@0.1.16)
└── request@2.67.0 (aws-sign2@0.6.0, forever-agent@0.6.1, tunnel-agent@0.4.2,
uth-sign@0.8.1, caseless@0.11.0, is-typedarray@1.0.0, stringstream@0.0.5, isst
am@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, tough-cookie@2.2.1, qs@5.2.
node-uuid@1.4.7, combined-stream@1.0.5, mime-types@2.1.10, form-data@1.0.0-rc
bl@1.0.3, hawk@3.1.3, http-signature@1.1.1, har-validator@2.0.6)

nw-    gyp@0.12.4 node_modules\nw-    gyp
├── graceful-fs@2.0.3
├── semver@2.2.1
├── osenv@0.1.3 (os-tmpdir@1.0.1, os-homedir@1.0.1)
├── minimatch@0.4.0 (sigmund@1.0.1, lru-cache@2.7.3)
├── nopt@2.2.1 (abbrev@1.0.7)
├── npmlog@0.1.1 (ansi@0.3.1)
├── fstream@0.1.31 (inherits@2.0.1, graceful-fs@3.0.8)
├── which@1.2.4 (isexe@1.1.2, is-absolute@0.1.7)
├── mkdirp@0.5.1 (minimist@0.0.8)
├── tar@0.1.20 (inherits@2.0.1, block-stream@0.0.8)
├── glob@3.2.11 (inherits@2.0.1, minimatch@0.3.0)
└── rimraf@2.5.2 (glob@7.0.0)

pan    gyp@2.3.3 node_modules\pan    gyp
├── which@1.0.9
├── graceful-fs@3.0.8
├── rimraf@2.2.8
├── osenv@0.1.3 (os-homedir@1.0.1, os-tmpdir@1.0.1)
├── semver@4.3.6
├── nopt@3.0.6 (abbrev@1.0.7)
├── fstream@1.0.8 (inherits@2.0.1, graceful-fs@4.1.3)
├── glob@4.3.5 (inherits@2.0.1, once@1.3.3, inflight@1.0.4)
├── minimatch@2.0.10 (brace-expansion@1.1.3)
├── mkdirp@0.5.1 (minimist@0.0.8)
├── tar@1.0.3 (inherits@2.0.1, block-stream@0.0.8)
├── npmlog@1.0.0 (ansi@0.3.1, gauge@1.0.2, are-we-there-yet@1.0.6)
└── request@2.51.0 (aws-sign2@0.5.0, forever-agent@0.5.2, caseless@0.8.0, oaut
sign@0.5.0, tunnel-agent@0.4.2, stringstream@0.0.5, json-stringify-safe@5.0.1,
ime-types@1.0.2, tough-cookie@2.2.1, qs@2.3.3, node-uuid@1.4.7, combined-strea
0.0.7, http-signature@0.10.1, form-data@0.2.0, bl@0.9.5, hawk@1.1.1)

lodash@3.10.1 node_modules\lodash

jshint@2.9.1 node_modules\jshint
├── strip-json-comments@1.0.4
├── exit@0.1.2
├── console-browserify@1.1.0 (date-now@0.1.4)
├── minimatch@2.0.10 (brace-expansion@1.1.3)
├── shelljs@0.3.0
├── cli@0.6.6 (glob@3.2.11)
├── htmlparser2@3.8.3 (domelementtype@1.3.0, entities@1.0.0, domhandler@2.3.0,
eadable-stream@1.1.13, domutils@1.5.1)
└── lodash@3.7.0

istanbul@0.3.22 node_modules\istanbul
├── abbrev@1.0.7
├── async@1.5.2
├── wordwrap@1.0.0
├── nopt@3.0.6
├── esprima@2.5.0
├── supports-color@3.1.2 (has-flag@1.0.0)
├── once@1.3.3 (wrappy@1.0.1)
├── which@1.2.4 (isexe@1.1.2, is-absolute@0.1.7)
├── mkdirp@0.5.1 (minimist@0.0.8)
├── fileset@0.2.1 (minimatch@2.0.10, glob@5.0.15)
├── resolve@1.1.7
├── escodegen@1.7.1 (estraverse@1.9.3, esutils@2.0.2, esprima@1.2.5, optionato
0.5.0, source-map@0.2.0)
├── js-yaml@3.5.3 (esprima@2.7.2, argparse@1.0.6)
└── handlebars@4.0.5 (optimist@0.6.1, source-map@0.4.4, uglify-js@2.6.2)

[nodegit] Detecting vendor/libgit2/fb6df50b7f250a4fd8b2fab257f119a5185e9bf5.
[nodegit] Detecting vendor/libssh2/1.4.3.
[nodegit] Detecting vendor/http_parser/2.5.0.
[nodegit] Detecting generated code.
[nodegit] vendor/libgit2/fb6df50b7f250a4fd8b2fab257f119a5185e9bf5 already exis
.
[nodegit] vendor/libssh2/1.4.3 already exists.
[nodegit] Generated code is intact.
[nodegit] Removing outdated vendor/http_parser/.
[nodegit] Retrieving vendor/http_parser/.
[nodegit] Successfully updated vendor/http_parser/2.5.0.
[nodegit] Everything is ready to go, attempting compilation
[nodegit] Building native node module.
{ [Error: Command failed: C:\Windows\system32\cmd.exe /s /c "C:\code\dpc\suppo
\node_modules\nodegit\node_modules\.bin\pan    gyp rebuild"
    gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: 404 status code downloading 64-bit node.lib
gyp ERR! stack     at Request.<anonymous> (C:\code\dpc\support\node_modules\no
git\node_modules\pan    gyp\lib\install.js:403:20)
gyp ERR! stack     at emitOne (events.js:82:20)
gyp ERR! stack     at Request.emit (events.js:169:7)
gyp ERR! stack     at Request.onRequestResponse (C:\code\dpc\support\node_modu
s\nodegit\node_modules\pan    gyp\node_modules\request\request.js:1255:10)
gyp ERR! stack     at emitOne (events.js:77:13)
gyp ERR! stack     at ClientRequest.emit (events.js:169:7)
gyp ERR! stack     at HTTPParser.parserOnIncomingClient (_http_client.js:415:2

gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:88:2

gyp ERR! stack     at Socket.socketOnData (_http_client.js:305:20)
gyp ERR! stack     at emitOne (events.js:77:13)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\code\\dpc\\support
node_modules\\nodegit\\node_modules\\pan    gyp\\bin\\node-    gyp.js" "rebuild"
gyp ERR! cwd C:\code\dpc\support\node_modules\nodegit
gyp ERR! node -v v4.2.0
gyp ERR! pan    gyp -v v2.3.3
gyp ERR! not ok
]
killed: false,
code: 1,
signal: null,
cmd: 'C:\\Windows\\system32\\cmd.exe /s /c "C:\\code\\dpc\\support\\node_mod
es\\nodegit\\node_modules\\.bin\\pan    gyp rebuild"' }
undefined
@0.4.1 ..\node_modules\nodegit
├── nodegit-promise@2.0.1 (asap@2.0.3)
├── which-native-nodish@1.1.3 (find-parent-dir@0.3.0, nodegit-promise@1.0.2)
└── npm@2.14.21

1 个答案:

答案 0 :(得分:0)

我从来没有弄清楚为什么这不起作用,但对于其他看到这个的人 - 我最终做的是npm install -g nodegit。然后我只是从安装了npm的地方复制了nodegit模块并且可以正常工作。