Skip to content
Dane Springmeyer edited this page Aug 23, 2013 · 19 revisions

Troubleshooting

If you see an error like Error: cannot find module 'mapnik' it means that you need to ensure that the mapnik folder is in your node_modules or otherwise on you NODE_PATH.

If you see an error like:

  Module._extensions[extension](this, filename);
                               ^
Error: Symbol blend_module not found.

Then it indicates you have either forgotten to use the NODE_MODULE macro or the name for your module in the binding.gyp does not match what is used in the NODE_MODULE.

If you see an error on like:

  Module._extensions[extensions](this,filename)

Error: the specified module cannot be found

This likely means that the module was found but that it cannot be loaded because it is unable to find other dynamic libraries it depends upon.

If you see an error on like:

  Module._extensions[extensions](this,filename)

Error: the specified procedure could not be found

This means that the module was found but that a symbol/function it references cannot be found, likely because of some stale build.

A nice way to figure out which module or symbol is missing is to use python's ctypes module to import the node module like:

$ python
>>> import ctypes
>>> ctypes.CDLL('./lib/_mapnik.node')

This should prompt and error to pop up in a new graphical window that presents like library name that is missing like:

or:

Hitting an error with node v0.6 or v0.8 like:

In file included from ../src/node_mapnik.cpp:13:
In file included from ../src/mapnik_feature.hpp:9:
In file included from /usr/local/include/mapnik/feature.hpp:28:
/usr/local/include/mapnik/value_types.hpp:27:10: fatal error: 'unicode/unistr.h' file not found
#include <unicode/unistr.h>  // for UnicodeString
         ^
1 error generated.
make: *** [Release/obj.target/_mapnik/src/node_mapnik.o] Error 1

or

In file included from ../src/mapnik_map.cpp:10:
../node_modules/mapnik-vector-tile/src/vector_tile_processor.hpp:27:10: fatal error: 'agg_conv_clip_polygon.h' file not found
#include "agg_conv_clip_polygon.h"
         ^
1 error generated.
make: *** [Release/obj.target/_mapnik/src/mapnik_map.o] Error 1
``

These either mean that critical -I (include) paths are missing from the build or that icu and mapnik are not installed. If you are using older node that contains older node-gyp then the former is the problem and you can work around the issue but doing:

```sh
export CXXFLAGS=`mapnik-config --cflags`
npm install mapnik
Clone this wiki locally