无法使用npm安装prerender – “无法find:CL.exe”

我一直试图在我的本地机器上安装PreRender.Io来testing。 我已经安装了Python 2.7.10。 当我input:

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上快速search似乎是一些缺less的Visual C ++编译器。 不过,我试过安装说VC ++ 2008可再发行的x86,但仍然是同样的问题。

任何想法可能是错的? 操作系统是Windows 7 64位。

我设法解决了这个问题,虽然这很奇怪。 老实说,我不确定哪个人完全解决了这个问题,因为我已经做了很多的事情。 我在我的机器上安装了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位于PATH环境variables。

  • pipe理员模式下运行的Visual Studio 2015中的Developer Command Prompt执行npm install prerender

我只是通过一个Angular JS教程,并有这个问题,但他们的文档表明这不是一个问题:

“我们经常在一系列g ERR ERR消息后看到一个npm WARN消息,忽略它们,一个包可能会尝试使用node-gyp重新编译自己,如果重新编译失败,包就会恢复内置版本),一切正常。“

https://angular.io/guide/quickstart