小编典典

无法使用npm安装prerender-“无法找到:CL.exe”

node.js

我一直在尝试PreRender.Io在本地计算机上安装进行测试。我已经安装了Python 2.7.10。当我键入:

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,但仍然是同样的问题。

知道有什么问题吗?操作系统是Windows 7 64位。


阅读 400

收藏
2020-07-07

共1个答案

小编典典

我设法解决了这个问题,尽管这很奇怪。老实说,我不确定是哪一个完全解决了问题,因为我做了很多工作。我已经在计算机上安装了Visual Studio
2015。以下是我所做的摘要:

  • 安装 Visual C ++编译 ,从VS 2015安装。默认情况下,它是未选中的。我认为这就是解决此问题的原因。

  • 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 环境变量中。

  • npm install prerenderDeveloper Command Prompt* Visual Studio 2015 的in中执行,以 管理员模式 运行 *

2020-07-07