Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Failed to install on macOS #88

Open
jkahn117 opened this issue Nov 15, 2016 · 6 comments
Open

Failed to install on macOS #88

jkahn117 opened this issue Nov 15, 2016 · 6 comments

Comments

@jkahn117
Copy link

jkahn117 commented Nov 15, 2016

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 in node-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
Copy link
Collaborator

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

@sumbulalvi
Copy link

sumbulalvi commented Dec 19, 2017

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
Copy link

dorshay6 commented Feb 2, 2018

+1

@xiankai
Copy link

xiankai commented Mar 5, 2018

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: #91

@jkao
Copy link

jkao commented Sep 18, 2019

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
Copy link

tkurki commented Aug 23, 2022

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants