tilemill-project / tilemill

TileMill is a modern map design studio
https://tilemill-project.github.io/tilemill/
BSD 3-Clause "New" or "Revised" License
3.1k stars 527 forks source link

mapnik.node: undefined symbol #2683

Closed MatchLemon closed 5 years ago

MatchLemon commented 5 years ago
internal/modules/cjs/loader.js:718
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: /opt/data/tilemill/node_modules/mapnik/lib/binding/mapnik.node: undefined symbol: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEi
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/opt/data/tilemill/node_modules/mapnik/lib/mapnik.js:31:15)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)

I get the error when I run ./index.js my os is CentOS 7 mapnik@3.7.2

csytsma commented 5 years ago

@MatchLemon what version of Node are you running? Did you try lts/carbon v8.11.x? How did you install this version of TileMill?

MatchLemon commented 5 years ago

@MatchLemon what version of Node are you running? Did you try lts/carbon v8.11.x? How did you install this version of TileMill?

my node is v8.15.0. my TileMill is master branch, run npm install & npm start

csytsma commented 5 years ago

I just attempted a fresh install on a VM instance of Ubuntu 18.04.2 LTS, with Node v8.15.1 and npm v6.4.1 and it installed and ran as expected.

To install, I followed the Quick Install directions on the README: git clone https://github.com/tilemill-project/tilemill.git cd tilemill npm install npm start

Don't use the older Ubuntu installation instructions, those are for pre v1.0.0, before the latest upgrade.

csytsma commented 5 years ago

@MatchLemon I get the same error if I didn't remove previously installed node_modules and do a clean install: From your local tilemill directory: rm -rf node_modules npm install

Can you please retest and report back?

yh371174229 commented 5 years ago

I meet this problem too.But I don't want to remove the node_modules,I wiil install in a offline machine,so I can't download the node packages online. @csytsma Is there another way to solve my problem?

csytsma commented 5 years ago

@younghappy, removing the node_modules directory in the project folder is typically a requirement when updating a node project package. You don't need to remove your global node_modules directory, just your ../tilemill/node_modules directory. You'll need to do this every time you upgrade TileMill, then run npm install again, to repopulate it with any new dependencies.