4

我正在尝试构建一个 expressJs 应用程序,一直在尝试安装“restify”来进行休息呼叫。出于某种原因,node-gyp 构建向我抛出了一个错误:

这是我拥有的版本:1.节点:v0.10.27 2.npm:1.4.8 3.express:4.0.0 4.python:27

我有 Windows 7 企业 64 位操作系统。

这是我尝试安装 restify 时的错误,我在尝试安装 nodemon 和其他几个节点模块包时看到了类似的错误:

$ npm install restify

npm http GET https://registry.npmjs.org/restify
npm http 304 https://registry.npmjs.org/restify
npm http GET https://registry.npmjs.org/bunyan
npm http GET https://registry.npmjs.org/backoff
npm http GET https://registry.npmjs.org/escape-regexp-component
npm http GET https://registry.npmjs.org/csv
npm http GET https://registry.npmjs.org/assert-plus
npm http GET https://registry.npmjs.org/keep-alive-agent
npm http GET https://registry.npmjs.org/tunnel-agent
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/negotiator
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/http-signature
npm http GET https://registry.npmjs.org/once
npm http GET https://registry.npmjs.org/dtrace-provider
npm http GET https://registry.npmjs.org/node-uuid
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/verror
npm http GET https://registry.npmjs.org/semver
npm http GET https://registry.npmjs.org/formidable
npm http GET https://registry.npmjs.org/deep-equal
npm http GET https://registry.npmjs.org/spdy
npm http 304 https://registry.npmjs.org/bunyan
npm http 304 https://registry.npmjs.org/assert-plus
npm http 304 https://registry.npmjs.org/backoff
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/negotiator
npm http 304 https://registry.npmjs.org/escape-regexp-component
npm http 304 https://registry.npmjs.org/csv
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/keep-alive-agent
npm http 304 https://registry.npmjs.org/once
npm http 304 https://registry.npmjs.org/node-uuid
npm http 304 https://registry.npmjs.org/qs
npm http 304 https://registry.npmjs.org/tunnel-agent
npm http 304 https://registry.npmjs.org/semver
npm http 304 https://registry.npmjs.org/deep-equal
npm http 304 https://registry.npmjs.org/http-signature
npm http 304 https://registry.npmjs.org/dtrace-provider
npm http 304 https://registry.npmjs.org/verror
npm http 304 https://registry.npmjs.org/formidable
npm http 304 https://registry.npmjs.org/spdy
npm http GET https://registry.npmjs.org/asn1
npm http GET https://registry.npmjs.org/ctype
npm http GET https://registry.npmjs.org/extsprintf
npm http 304 https://registry.npmjs.org/ctype

> dtrace-provider@0.2.8 install c:\apps\..\..\node_modules\restify\no
de_modules\dtrace-provider
> node-gyp rebuild


c:\apps\...\..\restify\node_modules\dtrace-provider>node
**"c:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\n
ode-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe".
 To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visua
l Studio 2005 or 3) add the location of the component to the system path if it
is installed elsewhere.  [c:\apps\trendy\trendy_ui\node_modules\restify\node_mo
dules\dtrace-provider\build\binding.sln]**
gyp ERR! build error
gyp ERR! stack Error: `C:\windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (c:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:807:
12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "c:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd c:\apps\trendy\trendy_ui\node_modules\restify\node_modules\dtrace-p
rovider
gyp ERR! node -v v0.10.27
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok
npm http 304 https://registry.npmjs.org/asn1
npm http 304 https://registry.npmjs.org/extsprintf
npm http GET https://registry.npmjs.org/mv
npm http 304 https://registry.npmjs.org/mv
npm WARN optional dep failed, continuing dtrace-provider@0.2.8
restify@2.7.0 node_modules\restify
├── assert-plus@0.1.5
├── once@1.3.0
├── tunnel-agent@0.4.0
├── deep-equal@0.0.0
├── mime@1.2.11
├── qs@0.6.6
├── escape-regexp-component@1.0.2
├── keep-alive-agent@0.0.1
├── lru-cache@2.3.1
├── negotiator@0.3.0
├── node-uuid@1.4.1
├── semver@2.2.1
├── backoff@2.3.0
├── verror@1.3.7 (extsprintf@1.0.2)
├── spdy@1.19.3
├── http-signature@0.10.0 (assert-plus@0.1.2, asn1@0.1.11, ctype@0.5.2)
├── formidable@1.0.14
├── bunyan@0.22.1 (mv@0.0.5)
└── csv@0.3.7

我是否使用了节​​点、npm 和 express 的错误版本组合?任何帮助,将不胜感激。

我尝试恢复到 Python33,然后收到一条错误消息,指出 node-gyp 仅支持 2.5 - 3 之间的 python 版本。

谢谢

4

1 回答 1

1

该错误与python版本无关。
node-gyp 有很多先决条件才能在 Windows 上运行,并且需要一些安装。按照此处的说明进行操作。

于 2014-09-26T12:22:40.180 回答