在Windows 10上的npm安装期间出现node-gyp错误

时间:2016-08-22 18:31:01

标签: node.js npm node-gyp

当我使用GitBash在Windows 10上执行npm install时,我收到了node-gyp的以下错误。我曾尝试重新安装node-gyp,但没有帮助。有谁知道如何解决这个问题?

$ npm install
npm WARN package.json lms@1.0.0 No description
npm WARN package.json lms@1.0.0 No README data

> libxmljs@0.14.3 install C:\Users\Jason\Desktop\Projects\brainiac\node_modules\js2xml\node_modules\libxmljs
> node-gyp rebuild


C:\Users\Jason\Desktop\Projects\brainiac\node_modules\js2xml\node_modules\libxmljs>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [C:\Users\Jason\Desktop\Projects\brainiac\node_modules\js2xml\node_modules\libxmljs\build\vendor\libxml\libxml.vcxproj]


gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\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:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Jason\Desktop\Projects\brainiac\node_modules\js2xml\node_modules\libxmljs
gyp ERR! node -v v4.4.3
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.4.3
npm ERR! npm  v2.15.1
npm ERR! code ELIFECYCLE

npm ERR! libxmljs@0.14.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the libxmljs@0.14.3 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the libxmljs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs libxmljs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls libxmljs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Jason\Desktop\Projects\brainiac\npm-debug.log

1 个答案:

答案 0 :(得分:0)

如果您已安装Visual Studio 2015 /其他完整软件包并出现此类错误,则可能有助于从“VS2015 x64 Native Tools命令提示符”运行npm安装 或首先调用“C:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ VC \ vcvarsall.bat”