Closed mlptownsend closed 5 months ago
Strange, I had no problem installing on debian 12 few days ago... Maybe the node version? I've just installed it and it's an inferior version than yours...
Here is what Ive got:
node --version v18.19.0
cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"
npm -version 9.2.0
npm list mapnik mapnik_nodejs@1.0.0 /root/mapnik_nodejs └── mapnik@4.5.9
I had the same issue install on Mac OS Sonoma (14.4.1 (23E224)) using Node 20. I tried each major node version (18,16,14) and 14 was the only version that installed successfully for me. I am gonna bump my node version back up, hopefully things work as expected. Would be nice to get some visibility and explanation on this - is this still a maintained project?
@simongroom - you mentioned macOS 14.4.1 but is it x86_64
or arm64
?
FYI, there is no binaries in 4.5.9
for arm64
(macbooks M1,M2,M3 etc). Binaries for arm64
are planned to be included in 4.6.0
release which will use mapnik 4.x.x as a core.
uname -m
??
Could you paste what error(s) you're seeing when running npm install mapnik
?
@simongroom - you mentioned macOS 14.4.1 but is it
x86_64
orarm64
?FYI, there is no binaries in
4.5.9
forarm64
(macbooks M1,M2,M3 etc). Binaries forarm64
are planned to be included in4.6.0
release which will use mapnik 4.x.x as a core.uname -m
??
Could you paste what error(s) you're seeing when running
npm install mapnik
?
@artemp thanks for the response!! I'm on arm64
.. currently using node 20.
and this is the output when attempting to pnpm install
(same result using npm install
):
node_modules/.pnpm/mapnik@4.5.8/node_modules/mapnik: Running install script, failed in 2.5s
.../mapnik@4.5.8/node_modules/mapnik install$ node-pre-gyp install --fallback-to-build
│ node-pre-gyp info it worked if it ends with ok
│ node-pre-gyp info using node-pre-gyp@1.0.11
│ node-pre-gyp info using node@20.12.2 | darwin | arm64
│ node-pre-gyp info check checked for "/Users/simon.groom/Code/geopointe-api/node_modules/.pnpm/mapnik@4.5.8/node_modules/mapnik/lib/binding/mapnik.node" (not found)
│ node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/mapnik/v4.5.8/Release/darwin-arm64.tar.gz
│ node-pre-gyp ERR! install response status 403 Forbidden on https://mapbox-node-binary.s3.amazonaws.com/mapnik/v4.5.8/Release/darwin-arm64.tar.gz
│ node-pre-gyp WARN Pre-built binaries not installable for mapnik@4.5.8 and node@20.12.2 (node-v115 ABI, unknown) (falling back to source compile with node-gyp)
│ node-pre-gyp WARN Hit error response status 403 Forbidden on https://mapbox-node-binary.s3.amazonaws.com/mapnik/v4.5.8/Release/darwin-arm64.tar.gz
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@10.0.1
│ gyp info using node@20.12.2 | darwin | arm64
│ gyp info ok
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@10.0.1
│ gyp info using node@20.12.2 | darwin | arm64
│ gyp info find Python using Python version 3.12.3 found at "/Library/Frameworks/Python.framework/Versions/3.12/bin/python3"
│ gyp http GET https://nodejs.org/download/release/v20.12.2/node-v20.12.2-headers.tar.gz
│ gyp http 200 https://nodejs.org/download/release/v20.12.2/node-v20.12.2-headers.tar.gz
│ gyp http GET https://nodejs.org/download/release/v20.12.2/SHASUMS256.txt
│ gyp http 200 https://nodejs.org/download/release/v20.12.2/SHASUMS256.txt
│ gyp info spawn /Library/Frameworks/Python.framework/Versions/3.12/bin/python3
│ gyp info spawn args [
│ gyp info spawn args '/Users/simon.groom/Library/pnpm/nodejs/20.12.2/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
│ gyp info spawn args 'binding.gyp',
│ gyp info spawn args '-f',
│ gyp info spawn args 'make',
│ gyp info spawn args '-I',
│ gyp info spawn args '/Users/simon.groom/Code/geopointe-api/node_modules/.pnpm/mapnik@4.5.8/node_modules/mapnik/build/config.gypi',
│ gyp info spawn args '-I',
│ gyp info spawn args '/Users/simon.groom/Code/geopointe-api/node_modules/.pnpm/mapnik@4.5.8/node_modules/mapnik/common.gypi',
│ gyp info spawn args '-I',
│ gyp info spawn args '/Users/simon.groom/Library/pnpm/nodejs/20.12.2/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
│ gyp info spawn args '-I',
│ gyp info spawn args '/Users/simon.groom/Library/Caches/node-gyp/20.12.2/include/node/common.gypi',
│ gyp info spawn args '-Dlibrary=shared_library',
│ gyp info spawn args '-Dvisibility=default',
│ gyp info spawn args '-Dnode_root_dir=/Users/simon.groom/Library/Caches/node-gyp/20.12.2',
│ gyp info spawn args '-Dnode_gyp_dir=/Users/simon.groom/Library/pnpm/nodejs/20.12.2/lib/node_modules/npm/node_modules/node-gyp',
│ gyp info spawn args '-Dnode_lib_file=/Users/simon.groom/Library/Caches/node-gyp/20.12.2/<(target_arch)/node.lib',
│ gyp info spawn args '-Dmodule_root_dir=/Users/simon.groom/Code/geopointe-api/node_modules/.pnpm/mapnik@4.5.8/node_modules/mapnik',
│ gyp info spawn args '-Dnode_engine=v8',
│ gyp info spawn args '--depth=.',
│ gyp info spawn args '--no-parallel',
│ gyp info spawn args '--generator-output',
│ gyp info spawn args 'build',
│ gyp info spawn args '-Goutput_dir=.'
│ gyp info spawn args ]
│ <string>:129: SyntaxWarning: invalid escape sequence '\$'
│ /bin/sh: mapnik-config: command not found
│ gyp: Call to 'mapnik-config --cflags' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
│ gyp ERR! configure error
│ gyp ERR! stack Error: `gyp` failed with exit code: 1
│ gyp ERR! stack at ChildProcess.<anonymous> (/Users/simon.groom/Library/pnpm/nodejs/20.12.2/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:271:18)
│ gyp ERR! stack at ChildProcess.emit (node:events:518:28)
│ gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
│ gyp ERR! System Darwin 23.4.0
│ gyp ERR! command "/Users/simon.groom/Library/pnpm/nodejs/20.12.2/bin/node" "/Users/simon.groom/Library/pnpm/nodejs/20.12.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fal…
│ gyp ERR! cwd /Users/simon.groom/Code/geopointe-api/node_modules/.pnpm/mapnik@4.5.8/node_modules/mapnik
│ gyp ERR! node -v v20.12.2
│ gyp ERR! node-gyp -v v10.0.1
│ gyp ERR! not ok
│ node-pre-gyp ERR! build error
│ node-pre-gyp ERR! stack Error: Failed to execute '/Users/simon.groom/Library/pnpm/nodejs/20.12.2/bin/node /Users/simon.groom/Library/pnpm/nodejs/20.12.2/lib/node_modules/npm/node_modules/node-gyp/bin/n…
│ node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/simon.groom/Code/geopointe-api/node_modules/.pnpm/@mapbox+node-pre-gyp@1.0.11/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
│ node-pre-gyp ERR! stack at ChildProcess.emit (node:events:518:28)
│ node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1105:16)
│ node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:305:5)
│ node-pre-gyp ERR! System Darwin 23.4.0
│ node-pre-gyp ERR! command "/Users/simon.groom/Library/pnpm/nodejs/20.12.2/bin/node" "/Users/simon.groom/Code/geopointe-api/node_modules/.pnpm/@mapbox+node-pre-gyp@1.0.11/node_modules/@mapbox/node-pre-g…
│ node-pre-gyp ERR! cwd /Users/simon.groom/Code/geopointe-api/node_modules/.pnpm/mapnik@4.5.8/node_modules/mapnik
│ node-pre-gyp ERR! node -v v20.12.2
│ node-pre-gyp ERR! node-pre-gyp -v v1.0.11
│ node-pre-gyp ERR! not ok
│ Failed to execute '/Users/simon.groom/Library/pnpm/nodejs/20.12.2/bin/node /Users/simon.groom/Library/pnpm/nodejs/20.12.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback…
└─ Failed in 2.5s at /Users/simon.groom/Code/geopointe-api/node_modules/.pnpm/mapnik@4.5.8/node_modules/mapnik
node_modules/.pnpm/nodemon@2.0.7/node_modules/nodemon: Running postinstall script, done in 147ms```
@simongroom
As I mentioned above, npm install
is attempting to download https://mapbox-node-binary.s3.amazonaws.com/mapnik/v4.5.8/Release/darwin-arm64.tar.gz
which doesn't exist. There are currently no binaries for arm64.
You have two options -
mapnik
and node-mapnik
yourself node-mapnik
v4.6.0
@artemp ok thank you. this makes sense.
@simongroom there is a third option you could try
3. run npm install
on Intel mac, then copy install directory including
~~node_modules~~
~~package-lock.json~~
~~package.json~~
to your arm64 Mac and it should just work because of pre-built support for x86_64 (at least in M2). Not ideal but might be a work around for the time being
PS. you will need to install Rosetta -> https://support.apple.com/en-us/102527~~
@simongroom ~there is a third option you could try~
~3. run
npm install
on Intel mac, then copy install directory including~~~node_modules~~ ~~package-lock.json~~ ~~package.json~~
~to your arm64 Mac and it should just work because of pre-built support for x86_64 (at least in M2). Not ideal but might be a work around for the time being~ PS. you will need to install Rosetta -> https://support.apple.com/en-us/102527~~
I've tried and it didn't work for me
bash-3.2$ ./node_modules/.bin/mapnik-inspect.js ~/projects/mapnik-consulting/mapnik-package-builder/mapnik/cairo-demo.svg > cairo-demo.png
node:internal/modules/cjs/loader:1465
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: dlopen(/private/tmp/mapnik/node_modules/mapnik/lib/binding/mapnik.node, 0x0001): tried: '/private/tmp/mapnik/node_modules/mapnik/lib/binding/mapnik.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/private/tmp/mapnik/node_modules/mapnik/lib/binding/mapnik.node' (no such file), '/private/tmp/mapnik/node_modules/mapnik/lib/binding/mapnik.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))
at Module._extensions..node (node:internal/modules/cjs/loader:1465:18)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Module._load (node:internal/modules/cjs/loader:1022:12)
at Module.require (node:internal/modules/cjs/loader:1231:19)
at require (node:internal/modules/helpers:179:18)
at Object.<anonymous> (/private/tmp/mapnik/node_modules/mapnik/lib/mapnik.js:31:15)
at Module._compile (node:internal/modules/cjs/loader:1369:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Module._load (node:internal/modules/cjs/loader:1022:12) {
code: 'ERR_DLOPEN_FAILED'
}
Node.js v20.12.1
thanks for trying @artemp I got this running inside a docker container for now, which is a viable workaround for the time being
thanks for trying @artemp I got this running inside a docker container for now, which is a viable workaround for the time being
as an update - I got this building in a docker container, but when I run it I am getting an error related to rosetta:
Rosetta error: could not find free space for allocation size
.
Not sure if this will be fixed by the new mapnik-node
version (seems unlikely) - but when do you envisage the new version will be available @artemp ?
circling back to my issue - I now have everything working in a docker container. My apparent prerequisites for the Dockerfile are:
1) change the docker image I was using:
FROM --platform=linux/amd64 ubuntu:20.04
not from node:20-alpine
or node:20-bookworm
2) then install node 18 and other deps via curl:
RUN apt-get install -y curl
RUN apt-get install -y imagemagick=8:6.*
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get install nodejs -y
posting here if anyone else ever finds there way to this.
I have the latest LTS node v20.11.0, installed python, the node installer checkbox for C++ build tools, so nothing should be missing dependency-wise. But running npm install mapnik is failing, and the error indicates that there's a zip file it can't download from S3. Did the file get deleted/moved/ACL changed?
403 Forbidden on https://mapbox-node-binary.s3.amazonaws.com/mapnik/v4.5.9/Release/win32-x64.tar.gz
2024-01-16T21_00_58_512Z-debug-0.log