sharedstreets / sharedstreets-js

SharedStreets (Node.js & Javascript)
https://sharedstreets.io
MIT License
77 stars 25 forks source link

install fails at osrm #54

Open todrobbins opened 5 years ago

todrobbins commented 5 years ago

Not sure what's wrong on my end, but this is what I get when trying to npm install -g sharedstreets:

➜  Desktop npm install -g sharedstreets
/Users/todrobbins/.nvm/versions/node/v12.2.0/bin/shst -> /Users/todrobbins/.nvm/versions/node/v12.2.0/lib/node_modules/sharedstreets/bin/run

> leveldown@5.1.0 install /Users/todrobbins/.nvm/versions/node/v12.2.0/lib/node_modules/sharedstreets/node_modules/leveldown
> node-gyp-build

> osrm@5.22.0 install /Users/todrobbins/.nvm/versions/node/v12.2.0/lib/node_modules/sharedstreets/node_modules/osrm
> node-pre-gyp install --fallback-to-build=false || ./scripts/node_install.sh

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp ERR! install error
node-pre-gyp ERR! stack Error: 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/osrm/v5.22.0/Release/node-v72-darwin-x64.tar.gz
node-pre-gyp ERR! stack     at PassThrough.<anonymous> (/Users/todrobbins/.nvm/versions/node/v12.2.0/lib/node_modules/sharedstreets/node_modules/osrm/node_modules/node-pre-gyp/lib/install.js:149:27)
node-pre-gyp ERR! stack     at PassThrough.emit (events.js:201:15)
node-pre-gyp ERR! stack     at ClientRequest.<anonymous> (/Users/todrobbins/.nvm/versions/node/v12.2.0/lib/node_modules/sharedstreets/node_modules/osrm/node_modules/needle/lib/needle.js:482:9)
node-pre-gyp ERR! stack     at Object.onceWrapper (events.js:284:20)
node-pre-gyp ERR! stack     at ClientRequest.emit (events.js:196:13)
node-pre-gyp ERR! stack     at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:572:23)
node-pre-gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:116:17)
node-pre-gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:459:22)
node-pre-gyp ERR! stack     at TLSSocket.emit (events.js:196:13)
node-pre-gyp ERR! stack     at addChunk (_stream_readable.js:290:12)
node-pre-gyp ERR! System Darwin 18.5.0
node-pre-gyp ERR! command "/Users/todrobbins/.nvm/versions/node/v12.2.0/bin/node" "/Users/todrobbins/.nvm/versions/node/v12.2.0/lib/node_modules/sharedstreets/node_modules/osrm/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build=false"
node-pre-gyp ERR! cwd /Users/todrobbins/.nvm/versions/node/v12.2.0/lib/node_modules/sharedstreets/node_modules/osrm
node-pre-gyp ERR! node -v v12.2.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok
403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/osrm/v5.22.0/Release/node-v72-darwin-x64.tar.gz
~/.nvm/versions/node/v12.2.0/lib/node_modules/sharedstreets/node_modules/osrm/build ~/.nvm/versions/node/v12.2.0/lib/node_modules/sharedstreets/node_modules/osrm
CMake Error: The source directory "/Users/todrobbins/.nvm/versions/node/v12.2.0/lib/node_modules/sharedstreets/node_modules/osrm" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! osrm@5.22.0 install: `node-pre-gyp install --fallback-to-build=false || ./scripts/node_install.sh`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the osrm@5.22.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
todrobbins commented 5 years ago

Is it my .nvm setup?

kpwebb commented 5 years ago

@todrobbins it looks like you might be running on a much older version of Node (v7.2?) can you confirm if this is the case?

The CLI currently requires node v10+ (it should do a check during install).

kpwebb commented 5 years ago

@todrobbins FYI, i've just added Docker setup steps to the README:

https://github.com/sharedstreets/sharedstreets-js/blob/master/README.md#docker

You should be able to use locally if you can upgrade Node, or use these.

todrobbins commented 5 years ago

I think you're right, I show the following for node/npm:

➜  which node
/Users/todrobbins/.nvm/versions/node/v12.2.0/bin/node
➜  which npm
/Users/todrobbins/.nvm/versions/node/v12.2.0/bin/npm

And:

➜  node -v
v12.2.0
➜  npm -v
6.9.0

🤷🏻‍♂️

kpwebb commented 5 years ago

@todrobbins not sure what's happening there -- the node version does show v12.2 but it looks like it's attempting to download OSRM for node v7.2:

https://mapbox-node-binary.s3.amazonaws.com/osrm/v5.22.0/Release/node-v72-darwin-x64.tar.gz

Not sure why that's happening but might be related to a conflict between nvm and another installed version of node?

kpwebb commented 5 years ago

Strike that: looks like the v72 in the URL is the "node module version" which is Node v12.2. It appears that Mapbox hasn't released OSRM binaries for Node v12 yet. We'll update the docs to reflect this.

hbruch commented 5 years ago

I ran into the same issue (node 12 instead of 10).

With nvm, I was able to install an additional node10 version:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
nvm install 10
nvm use 10
TyceHerrman commented 4 years ago

I was able to successfully use the CLI after installing node11 with nvm. I had the same issue as others when using the most recent version of node (node14). I didn't attempt to use the CLI with node12. Seems https://github.com/sharedstreets/trip-simulator/issues/18 is related issue.