无法使用 npm 安装预渲染 - “无法定位:CL.exe" [英] could not install prerender using npm - "Failed to locate: CL.exe"

查看:63
本文介绍了无法使用 npm 安装预渲染 - “无法定位:CL.exe"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试在本地机器上安装 PreRender.Io 以进行测试.我已经安装了 Python 2.7.10.当我输入:

I've been trying to install PreRender.Io on my local machine to test. I've installed Python 2.7.10. When I type:

npm install prerender

它给出了一个错误:

C:\PreRender\node_modules\prerender\node_modules\phantom\node_modules\dnode\node
_modules\weak>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:\PreRender\node_modules\prerender\node_modules\phantom\node
_modules\dnode\node_modules\weak\build\weakref.vcxproj]


gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` fail
ed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074
:12)
gyp ERR! System Windows_NT 6.1.7601

我找不到 CL.exe,在 Google 上快速搜索似乎缺少一些 Visual C++ 编译器.但是,我尝试安装说 VC++ 2008 可再发行 x86,但仍然存在同样的问题.

I couldn't locate CL.exe, and a quick search on Google seems to be some missing Visual C++ compiler. However, I tried installing say VC++ 2008 redistributable x86, but still same problem.

知道哪里出了问题吗?操作系统是 Windows 7 64 位.

Any idea what could be wrong? OS is Windows 7 64-bit.

推荐答案

我已经设法解决了这个问题,虽然它很奇怪.老实说,我不确定哪一个完全解决了它,因为我已经做了很多事情.我已经在我的机器上安装了 Visual Studio 2015.以下是我所做的总结:

I've managed to solve the problem, although it was quite strange. Honestly, I'm not sure which one solved it completely as I've done quite some stuff. I had installed Visual Studio 2015 on my machine. Below is a summary of what I've done:

  • 已安装 Visual C++ 编译器,来自 VS 2015 安装.默认情况下它是未选中的.我认为这就是解决问题的方法.

  • Installed Visual C++ Compiler, from the VS 2015 installation. By default it was unticked. I think this is what fixed the issue.

添加了 CL.exe (C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin) 所在的路径stdlib.h (C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include) 位于 PATH 环境变量中.

  • 在 Visual Studio 2015 的 Developer Command Prompt 中执行 npm install prerender,以管理员模式运行>
  • Added the path where CL.exe (C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin) and stdlib.h (C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include) are located to the PATH environment variable.

    这篇关于无法使用 npm 安装预渲染 - “无法定位:CL.exe"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆