当前位置 : 主页 > 网页制作 > Nodejs >

node.js – NPM安装错误 – node-gyp

来源:互联网 收集:自由互联 发布时间:2021-06-16
尝试安装xml-stream包但它仍然无法构建依赖项.它似乎需要vc2010(vcbuild.exe),但我安装了.Net Framework 2.0 SDK,它有vcbuild文件,我在安装xml-stream时遇到以下错误: node-expat@2.0.0 install G:\Pessoal\node\
尝试安装xml-stream包但它仍然无法构建依赖项.它似乎需要vc2010(vcbuild.exe),但我安装了.Net Framework 2.0 SDK,它有vcbuild文件,我在安装xml-stream时遇到以下错误:

> node-expat@2.0.0 install G:\Pessoal\node\bugzilla\node_modules\xml-stream\node
_modules\node-expat
> node-gyp rebuild


G:\Pessoal\node\bugzilla\node_modules\xml-stream\node_modules\node-expat>node "D
:\Bin\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-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.
  The following error has occurred during XML parsing:

  File: G:\Pessoal\node\bugzilla\node_modules\xml-stream\node_modules\node-expa
  t\build\deps\libexpat\expat.vcproj
  Line: 1
  Column: 4916
VCBUILD : error Message:  [G:\Pessoal\node\bugzilla\node_modules\xml-stream\nod
e_modules\node-expat\build\binding.sln]
  Erro de sistema: -2147154687.

  The file 'G:\Pessoal\node\bugzilla\node_modules\xml-stream\node_modules\node-
  expat\build\deps\libexpat\expat.vcproj' has failed to load.
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 (D:\Bin\nodejs\node_modules\npm\node_m
odules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:
12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "D:\\Bin\\nodejs\\node_modules\\npm\\node_modules\\node-
gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd G:\Pessoal\node\bugzilla\node_modules\xml-stream\node_modules\node-
expat
gyp ERR! node -v v0.10.30
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
我相信这种情况正在发生,因为xml-stream依赖于node-expat,它依赖于node-gyp,在windows上需要你安装VS2007或以其他方式安装node-gyp所需的正确SDK.

在我的情况下,我不想跳过这些箍,发现简单地使用sax编写一个非常简单的XML解析器而不依赖于node-gyp更容易.
我把它放在NPM:https://www.npmjs.com/package/no-gyp-xml-stream上
或者只运行:npm install no-gyp-xml-stream

它仍然是一项正在进行中的工作,但它的工作原理很容易使用,它允许您通过回调读取返回子元素的流上的大型XML文件.而且它的唯一依赖是sax,它不需要你安装任何东西.

网友评论