mapbox / node-s2

bindings for s2 in node
88 stars 38 forks source link

Failed to install on macOS #88

Open jkahn117 opened 7 years ago

jkahn117 commented 7 years ago

Failed to install on macOS, using NodeJS (7.1.0) and npm (4.0.2) installed via Homebrew (upgraded npm after brew install).

node-pre-gyp ERR! UNCAUGHT EXCEPTION node-pre-gyp ERR! stack Error: Cannot find module 'internal/fs' node-pre-gyp ERR! stack at Function.Module._resolveFilename (module.js:472:15) node-pre-gyp ERR! stack at Function.Module._load (module.js:420:25) node-pre-gyp ERR! stack at Module.require (module.js:500:17) node-pre-gyp ERR! stack at require (internal/module.js:20:19) node-pre-gyp ERR! stack at evalmachine.<anonymous>:17:20 node-pre-gyp ERR! stack at Object.<anonymous> (/Users/.../server/aroundme/node_modules/s2/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/fs.js:11:8) node-pre-gyp ERR! stack at Module._compile (module.js:573:32) node-pre-gyp ERR! stack at Object.Module._extensions..js (module.js:582:10) node-pre-gyp ERR! stack at Module.load (module.js:490:32) node-pre-gyp ERR! stack at tryModuleLoad (module.js:449:12) node-pre-gyp ERR! System Darwin 16.1.0 node-pre-gyp ERR! command "/usr/local/Cellar/node/7.1.0/bin/node" "/Users/.../server/aroundme/node_modules/s2/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /Users/.../server/aroundme/node_modules/s2 node-pre-gyp ERR! node -v v7.1.0 node-pre-gyp ERR! node-pre-gyp -v v0.5.31 node-pre-gyp ERR! This is a bug innode-pre-gyp`. node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help: node-pre-gyp ERR! https://github.com/mapbox/node-pre-gyp/issues aroundme@1.0.0 /Users/.../server/aroundme └── (empty)

npm WARN aroundme@1.0.0 No repository field. npm WARN aroundme@1.0.0 No license field. npm ERR! Darwin 16.1.0 npm ERR! argv "/usr/local/Cellar/node/7.1.0/bin/node" "/usr/local/bin/npm" "install" "s2" npm ERR! node v7.1.0 npm ERR! npm v4.0.2 npm ERR! code ELIFECYCLE

npm ERR! s2@0.5.0 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 7 npm ERR! npm ERR! Failed at the s2@0.5.0 install script 'node-pre-gyp install --fallback-to-build'. npm ERR! Make sure you have the latest version of node.js and npm installed.`

gerhardberger commented 7 years ago

It seems this is an issue with the upgrading of node and npm.

sumbulalvi commented 6 years ago

I tried uninstalling and installing node/npm as advised in the linked thread and still have this issue. Getting the following error:

error /Users/<Project_path>/node_modules/@mapbox/s2: Command failed.
Exit code: 7
Command: node-pre-gyp install --fallback-to-build
Arguments: 
Directory: /Users/<Project_path>/node_modules/@mapbox/s2
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.5.31
node-pre-gyp info using node@8.9.3 | darwin | x64
node-pre-gyp ERR! UNCAUGHT EXCEPTION 
node-pre-gyp ERR! stack Error: Cannot find module 'internal/util/types'
node-pre-gyp ERR! stack     at Function.Module._resolveFilename (module.js:536:15)
node-pre-gyp ERR! stack     at Function.Module._load (module.js:466:25)
node-pre-gyp ERR! stack     at Module.require (module.js:579:17)
node-pre-gyp ERR! stack     at require (internal/module.js:11:18)
node-pre-gyp ERR! stack     at evalmachine.<anonymous>:31:26
node-pre-gyp ERR! stack     at Object.<anonymous> (/Users/<Project_path>/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/fs.js:11:8)
node-pre-gyp ERR! stack     at Module._compile (module.js:635:30)
node-pre-gyp ERR! stack     at Object.Module._extensions..js (module.js:646:10)
node-pre-gyp ERR! stack     at Module.load (module.js:554:32)
node-pre-gyp ERR! stack     at tryModuleLoad (module.js:497:12)
node-pre-gyp ERR! System Darwin 16.7.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/<Project_path>/node_modules/@mapbox/s2/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/<Project_path>/node_modules/@mapbox/s2
node-pre-gyp ERR! node -v v8.9.3
node-pre-gyp ERR! node-pre-gyp -v v0.5.31
dorshay6 commented 6 years ago

+1

xiankai commented 6 years ago

For anyone still encountering this issue, one way to fix it is to (temporarily) downgrade your version of node to 6 or lower, or use clone this pull request instead: https://github.com/mapbox/node-s2/pull/91

jkao commented 5 years ago

FWIW I've been working on a newer actively developed Node S2 that we're using over at Radar: https://github.com/radarlabs/s2

It's built on the N-API so we support Node 10 and above (we return S2 IDs as BigInts, thus the requirement, otherwise Node 8 and above would be fine), whereas this lib needs some changes in the V8 call sites to be able to support higher versions. We've tested building on OS X and the official docker node images (Linux), and it's in use in production, at peak 10k QPS.

tkurki commented 2 years ago

This is what I get today:

npm ERR! node-pre-gyp info using node-pre-gyp@0.5.31
npm ERR! node-pre-gyp info using node@16.6.2 | darwin | arm64
npm ERR! node-pre-gyp ERR! UNCAUGHT EXCEPTION 
npm ERR! node-pre-gyp ERR! stack ReferenceError: primordials is not defined
npm ERR! node-pre-gyp ERR! stack     at evalmachine.<anonymous>:47:5
npm ERR! node-pre-gyp ERR! stack     at Object.<anonymous> (/Users/myuserid/git-workspace/myproject/influxdb2/node_modules/@mapbox/s2/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/fs.js:11:8)
npm ERR! node-pre-gyp ERR! stack     at Module._compile (node:internal/modules/cjs/loader:1101:14)
npm ERR! node-pre-gyp ERR! stack     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
npm ERR! node-pre-gyp ERR! stack     at Module.load (node:internal/modules/cjs/loader:981:32)
npm ERR! node-pre-gyp ERR! stack     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
npm ERR! node-pre-gyp ERR! stack     at Module.require (node:internal/modules/cjs/loader:1005:19)
npm ERR! node-pre-gyp ERR! stack     at require (node:internal/modules/cjs/helpers:94:18)
npm ERR! node-pre-gyp ERR! stack     at Object.<anonymous> (/Users/myuserid/git-workspace/myproject/influxdb2/node_modules/@mapbox/s2/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js:3:27)
npm ERR! node-pre-gyp ERR! stack     at Module._compile (node:internal/modules/cjs/loader:1101:14)
npm ERR! node-pre-gyp ERR! System Darwin 21.3.0