"npm install leaflet-headless"; Python安装后返回错误 [英] "npm install leaflet-headless" returning errors after Python installation

查看:80
本文介绍了"npm install leaflet-headless"; Python安装后返回错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行命令'npm install leaflet-headless',以便可以将Node.js的传单地图API轻松使用.我刚刚安装了Python并设置了目录(因为这是此特定安装中的上一个错误),但是现在我收到了一个我无法完全解读的新错误:

I'm trying to run the command 'npm install leaflet-headless' so I can use the leaflet map API with Node.js easily. I just installed Python and set the directory (as this was the previous error in this particular installation), but now I am getting a new error which I can't quite decipher:

注意-我猜想这需要GTK,尽管我只是不知道如何设置它以用于此特定命令.所有安装似乎都不在此命令所需的目录中.

Note - I'm guessing this requires GTK, though I just have no idea how to set it for use with this specific command. All the installs seem to not be in the directory required by this command.

> canvas@1.3.16 install C:\Users\Rocco\Desktop\Node3\kdApp\node_modules\leaflet-headless\node_modules\canvas
> node-gyp rebuild


C:\Users\Rocco\Desktop\Node3\kdApp\node_modules\leaflet-headless\node_modules\canvas>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 )
Warning: Missing input files:
C:\GTK\bin\zlib1.dll
C:\GTK\bin\libexpat-1.dll
C:\GTK\bin\libpng14-14.dll
C:\GTK\bin\libcairo-2.dll
C:\GTK\bin\libfontconfig-1.dll
C:\GTK\bin\libfreetype-6.dll
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  Canvas.cc
  CanvasGradient.cc
  CanvasPattern.cc
  CanvasRenderingContext2d.cc
c:\users\rocco\desktop\node3\kdapp\node_modules\leaflet-headless\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: 'cairo.h': No such file or directory (compiling source file ..\src\CanvasGradient.cc) [C:\Users\Rocco\Desktop\Node3\kdApp\node_modules\leaflet-headless\node_modules\can
vas\build\canvas.vcxproj]
c:\users\rocco\desktop\node3\kdapp\node_modules\leaflet-headless\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: 'cairo.h': No such file or directory (compiling source file ..\src\Canvas.cc) [C:\Users\Rocco\Desktop\Node3\kdApp\node_modules\leaflet-headless\node_modules\canvas\buil
d\canvas.vcxproj]
c:\users\rocco\desktop\node3\kdapp\node_modules\leaflet-headless\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: 'cairo.h': No such file or directory (compiling source file ..\src\CanvasPattern.cc) [C:\Users\Rocco\Desktop\Node3\kdApp\node_modules\leaflet-headless\node_modules\canv
as\build\canvas.vcxproj]
  color.cc
  Image.cc
  ImageData.cc
c:\users\rocco\desktop\node3\kdapp\node_modules\leaflet-headless\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: 'cairo.h': No such file or directory (compiling source file ..\src\Image.cc) [C:\Users\Rocco\Desktop\Node3\kdApp\node_modules\leaflet-headless\node_modules\canvas\build
\canvas.vcxproj]
c:\users\rocco\desktop\node3\kdapp\node_modules\leaflet-headless\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: 'cairo.h': No such file or directory (compiling source file ..\src\ImageData.cc) [C:\Users\Rocco\Desktop\Node3\kdApp\node_modules\leaflet-headless\node_modules\canvas\b
uild\canvas.vcxproj]
  init.cc
  win_delay_load_hook.cc
c:\users\rocco\desktop\node3\kdapp\node_modules\leaflet-headless\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: 'cairo.h': No such file or directory (compiling source file ..\src\init.cc) [C:\Users\Rocco\Desktop\Node3\kdApp\node_modules\leaflet-headless\node_modules\canvas\build\
canvas.vcxproj]
c:\users\rocco\desktop\node3\kdapp\node_modules\leaflet-headless\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: 'cairo.h': No such file or directory (compiling source file ..\src\CanvasRenderingContext2d.cc) [C:\Users\Rocco\Desktop\Node3\kdApp\node_modules\leaflet-headless\node_m
odules\canvas\build\canvas.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.14393
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\Rocco\Desktop\Node3\kdApp\node_modules\leaflet-headless\node_modules\canvas
gyp ERR! node -v v4.6.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok

> contextify@0.1.15 install C:\Users\Rocco\Desktop\Node3\kdApp\node_modules\leaflet-headless\node_modules\jsdom\node_modules\contextify
> node-gyp rebuild


C:\Users\Rocco\Desktop\Node3\kdApp\node_modules\leaflet-headless\node_modules\jsdom\node_modules\contextify>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.
  contextify.cc
  win_delay_load_hook.cc
     Creating library C:\Users\Rocco\Desktop\Node3\kdApp\node_modules\leaflet-headless\node_modules\jsdom\node_modules\contextify\build\Release\contextify.lib and object C:\Users\Rocco\Desktop\Node3\kdApp\node_modules\leaflet-headless\node_modules\jsdom\node_modules\contextify\build\Release\contextify.exp
  Generating code
  Finished generating code
  contextify.vcxproj -> C:\Users\Rocco\Desktop\Node3\kdApp\node_modules\leaflet-headless\node_modules\jsdom\node_modules\contextify\build\Release\\contextify.node
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "leaflet-headless"
npm ERR! node v4.6.0
npm ERR! npm  v2.15.9
npm ERR! code ELIFECYCLE

npm ERR! canvas@1.3.16 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@1.3.16 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the canvas 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 canvas
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls canvas
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Rocco\Desktop\Node3\kdApp\npm-debug.log

推荐答案

node-gyp需要安装python和Visual Studio及其可执行文件的路径.这种解决方法为我解决了这个问题:

node-gyp needs python and Visual Studio installed and the path to their executables. This walkaround fixed it for me:

卸载以下产品,然后按照列出的顺序重新安装它们:

Uninstall the following products and then reinstall them in the order listed:

1) Visual C ++ 2010 Express

2) Windows SDK 7.1

3) Visual Studio 2010 SP1

4)用于Windows SDK 7.1的Visual C ++ 2010 SP1编译器更新

请确保您的环境路径设置正确!

Be sure that you env paths are set correctly !

这篇关于"npm install leaflet-headless"; Python安装后返回错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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