2

I have been spending the last few days trying to get node-mapnik running but with no success.

Initially inspired by Wilhelm Berg's demo which renders pure vector maps using node-mapnik I was interested in getting this running on a Windows Server.

I have worked through all of the StackExchange issues on these topics including Wilhelm's checklist for getting this working on Windows 7 x64 but I am at a dead end and my knowledge is really limited in being able to further diagnose the problem.

My environment is:

  • Windows 2008 Server R2 x64
  • Visual Studio Express 2012 Desktop Edition (32 & 64 bit)
  • Node.js v0.10.26 (64 bit)
  • Python27 (32 bit)

I have taken the following steps:

  1. Installed Mapnik 2.2.0 SDK downloaded from git and placed in C:\apps\mapnik-v2.2.0

  2. Added to PATH:
    C:\apps\mapnik-v2.2.0\lib
    C:\apps\mapnik-v2.2.0\bin

  3. Installed Python v2.7 (32bit) downloaded and placed in C:\apps\python27

  4. Added to PATH:
    C:\apps\python27
    C:\apps\python27\scripts

  5. Added to PYTHONPATH:
    C:\apps\Python27\Lib; C:\apps\Python27\DLLs; C:\apps\Python27\Lib\lib-tk; C:\apps\mapnik-v2.2.0\python\2.7\site-packages;

  6. Rebuild node-gyp using VS 2012

    node-gyp rebuild --msvs_version=2012
    
  7. Downloaded and installed protobuf (32 bit) and placed in c:\apps\protobuf

  8. Added to PATH:
    C:\apps\protobuf

  9. Installed protobuf using NPM

    npm install protobuf --msvs_version=2012
    
  10. Downloaded Cairo using git

    git clone git://anongit.freedesktop.org/git/cairo
    
  11. Copy Cairo files to mapnik:
    Copy cairo\src\cairo-svg-surface.c to C:\apps\mapnik-v2.2.0\include
    Copy cairo\src\cairo-svg.h to C:\apps\mapnik-v2.2.0\include
    Copy cairo\src\cairo-svg-surface-private.h to C:\apps\mapnik-v2.2.0\include

  12. Make proj4 epsg files available:

    SET PROJ_LIB=C:\apps\mapnik-v2.2.0\share\proj
    
  13. Attempt to install node-mapnik

    npm install node-mapnik --msvs_version=2012
    

I receive the following errors:

node-pre-gyp ERR! Source compile required: 404 status code downloading tarball ...

mapnik_grid.cpp c:\users\administrator\node_modules\node-mapnik\build\release\obj\global_interm ediate\vector_tile.pb.h(9): fatal error C1083: Cannot open include file: 'google/protobuf/stubs/common.h': No such file or directory (C:\Users\Administrator\n ode_modules\node-mapnik\build\Release\obj\global_intermediate\vector_tile.pb.cc) [C:\Users\Administrator\node_modules\node-mapnik\build\mapnik.vcxproj] c:\users\administrator\node_modules\node-mapnik\src\utils.hpp(11): fatal error C1083: Cannot open include file: 'mapnik/unicode.hpp': No such file or director y (..\src\mapnik_geometry.cpp) [C:\Users\Administrator\node_modules\node-mapnik \build\mapnik.vcxproj] mapnik_layer.cpp mapnik_cairo_surface.cpp c:\users\administrator\node_modules\node-mapnik\src\mapnik_featureset.hpp(6): f atal error C1083: Cannot open include file: 'mapnik/datasource_cache.hpp': No s uch file or directory (..\src\mapnik_featureset.cpp) [C:\Users\Administrator\no de_modules\node-mapnik\build\mapnik.vcxproj] mapnik_image.cpp C:\Users\Administrator\node_modules\node-mapnik\node_modules\mapnik-vector-tile \src\mapnik3x_compatibility.hpp(4): fatal error C1083: Cannot open include file : 'mapnik/version.hpp': No such file or directory (..\src\mapnik_map.cpp) [C:\U sers\Administrator\node_modules\node-mapnik\build\mapnik.vcxproj]
mapnik_datasource.cpp C:\Users\Administrator\node_modules\node-mapnik\node_modules\mapnik-vector-tile \src\mapnik3x_compatibility.hpp(4): fatal error C1083: Cannot open include file : 'mapnik/version.hpp': No such file or directory (..\src\mapnik_color.cpp) [C: \Users\Administrator\node_modules\node-mapnik\build\mapnik.vcxproj]
node_mapnik.cpp ..\src\mapnik_grid_view.cpp(9): fatal error C1083: Cannot open include file: 'm apnik/grid/grid.hpp': No such file or directory [C:\Users\Administrator\node_mo dules\node-mapnik\build\mapnik.vcxproj] mapnik_projection.cpp C:\Users\Administrator\node_modules\node-mapnik\node_modules\mapnik-vector-tile \src\mapnik3x_compatibility.hpp(4): fatal error C1083: Cannot open include file : 'mapnik/version.hpp': No such file or directory (..\src\mapnik_layer.cpp) [C: \Users\Administrator\node_modules\node-mapnik\build\mapnik.vcxproj]
mapnik_feature.cpp ..\src\mapnik_grid.cpp(9): fatal error C1083: Cannot open include file: 'mapnik /version.hpp': No such file or directory [C:\Users\Administrator\node_modules\n ode-mapnik\build\mapnik.vcxproj] mapnik_palette.cpp ..\src\mapnik_image_view.cpp(11): fatal error C1083: Cannot open include file: 'mapnik/color.hpp': No such file or directory [C:\Users\Administrator\node_modu les\node-mapnik\build\mapnik.vcxproj] mapnik_vector_tile.cpp c:\users\administrator\node_modules\node-mapnik\src\utils.hpp(11): fatal error C1083: Cannot open include file: 'mapnik/unicode.hpp': No such file or director y (..\src\mapnik_cairo_surface.cpp) [C:\Users\Administrator\node_modules\node-m apnik\build\mapnik.vcxproj] mapnik_expression.cpp
mapnik_memory_datasource.cpp ..\src\mapnik_memory_datasource.cpp(3): fatal error C1083: Cannot open include file: 'mapnik/version.hpp': No such file or directory [C:\Users\Administrator\n ode_modules\node-mapnik\build\mapnik.vcxproj] c:\users\administrator\node_modules\node-mapnik\src\utils.hpp(11): fatal error C1083: Cannot open include file: 'mapnik/unicode.hpp': No such file or director y (..\src\mapnik_feature.cpp) [C:\Users\Administrator\node_modules\node-mapnik\ build\mapnik.vcxproj] ..\src\mapnik_image.cpp(7): fatal error C1083: Cannot open include file: 'mapni k/color.hpp': No such file or directory [C:\Users\Administrator\node_modules\no de-mapnik\build\mapnik.vcxproj] C:\Users\Administrator\node_modules\node-mapnik\node_modules\mapnik-vector-tile \src\mapnik3x_compatibility.hpp(4): fatal error C1083: Cannot open include file : 'mapnik/version.hpp': No such file or directory (..\src\mapnik_datasource.cpp ) [C:\Users\Administrator\node_modules\node-mapnik\build\mapnik.vcxproj] C:\Users\Administrator\node_modules\node-mapnik\node_modules\mapnik-vector-tile \src\mapnik3x_compatibility.hpp(4): fatal error C1083: Cannot open include file : 'mapnik/version.hpp': No such file or directory (..\src\mapnik_projection.cpp ) [C:\Users\Administrator\node_modules\node-mapnik\build\mapnik.vcxproj] C:\Users\Administrator\node_modules\node-mapnik\node_modules\mapnik-vector-tile \src\mapnik3x_compatibility.hpp(4): fatal error C1083: Cannot open include file : 'mapnik/version.hpp': No such file or directory (..\src\mapnik_palette.cpp) [ C:\Users\Administrator\node_modules\node-mapnik\build\mapnik.vcxproj] C:\Users\Administrator\node_modules\node-mapnik\node_modules\mapnik-vector-tile \src\mapnik3x_compatibility.hpp(4): fatal error C1083: Cannot open include file : 'mapnik/version.hpp': No such file or directory (..\src\node_mapnik.cpp) [C:\ Users\Administrator\node_modules\node-mapnik\build\mapnik.vcxproj] c:\users\administrator\node_modules\node-mapnik\src\utils.hpp(11): fatal error C1083: Cannot open include file: 'mapnik/unicode.hpp': No such file or director y (..\src\mapnik_vector_tile.cpp) [C:\Users\Administrator\node_modules\node-map nik\build\mapnik.vcxproj]

1

I had the same kind of errors, that came from the fallback "build-from-source" because npm couldn't find pre-compiled packaged. Turns out I had Node 64 bits installed. I just switched to Node 32 bits, cleared my node_modules folder and everything built well (with a few errors on an optional dep but nothing blocking).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.