could not install prerender using npm - “Failed to locate: CL.exe”

后端 未结 3 1893
时光说笑
时光说笑 2020-12-29 04:19

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<

相关标签:
3条回答
  • 2020-12-29 04:24

    I'm just going through an Angular JS tutorial and had this issue, but their docs suggest it isn't a problem:

    "We often see an npm WARN message after a series of gyp ERR! messages. Ignore them. A package may try to re-compile itself using node-gyp. If the re-compile fails, the package recovers (typically with a pre-built version) and everything works."

    https://angular.io/guide/quickstart

    0 讨论(0)
  • 2020-12-29 04:32

    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:

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

    • 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.

    • Executed the npm install prerender from the Developer Command Prompt in of Visual Studio 2015, running in Administrator mode
    0 讨论(0)
  • 2020-12-29 04:33

    For me the problem came after installing a new version of node. npm install would show the error above. Then I got the error above but not for the package PreRender.Io but for gulp-sass, though I believe the problem has the same root. To solve it, I installed the previous version of node I'd been using (6.9.5) and then I used nvm to manage node versions as described here: https://www.sitepoint.com/quick-tip-multiple-versions-node-nvm/

    Switching to the previous version of node using nvm meant I could do npm install without having to install a large SDK I wasn't going to end up using.

    0 讨论(0)
提交回复
热议问题