BlinkTagInc / gtfs-to-html

Build human readable transit timetables as HTML or PDF from GTFS.
https://gtfstohtml.com
MIT License
181 stars 57 forks source link

unable to install globally on a clean ubuntu 20.04 64bit #89

Closed wkulesza closed 3 years ago

wkulesza commented 4 years ago

Hey, first of all, great project (if only i'd be able to run it on my server). I've been scratching my head but were unable to start it on a fresh Ubuntu 20.04 server 64bit. After installing npm, i went ahead to install this globally as a sudo user, but got a lot of errors.

My node log is below. Could anyone point out what i'm doing wrong (i've been trying to install this as a normal user too - then of course i get a lot of permission errors) and also install this not globally (without -g flag). then gtfs-to-html command is not found.

9344 silly install minizlib@1.3.3
9345 info lifecycle minizlib@1.3.3~install: minizlib@1.3.3
9346 silly install tar@4.4.13
9347 info lifecycle tar@4.4.13~install: tar@4.4.13
9348 silly install node-pre-gyp@0.11.0
9349 info lifecycle node-pre-gyp@0.11.0~install: node-pre-gyp@0.11.0
9350 silly install sqlite3@5.0.0
9351 info lifecycle sqlite3@5.0.0~install: sqlite3@5.0.0
9352 verbose lifecycle sqlite3@5.0.0~install: unsafe-perm in lifecycle false
9353 verbose lifecycle sqlite3@5.0.0~install: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/lib/node_modules/gtfs-to-html/node_modules/sqlite3/node_modules/.bin:/usr/lib/node_modules/gtfs-to-html/node_modules/.bin:/usr/lib/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
9354 verbose lifecycle sqlite3@5.0.0~install: CWD: /usr/lib/node_modules/gtfs-to-html/node_modules/sqlite3
9355 silly lifecycle sqlite3@5.0.0~install: Args: [ '-c', 'node-pre-gyp install --fallback-to-build' ]
9356 silly lifecycle sqlite3@5.0.0~install: Returned: code: 1  signal: null
9357 info lifecycle sqlite3@5.0.0~install: Failed to exec install script
9358 timing action:install Completed in 1054ms
9359 verbose unlock done using /root/.npm/_locks/staging-a072192f34a17023.lock for /usr/lib/node_modules/.staging
9360 timing stage:rollbackFailedOptional Completed in 1116ms
9361 timing stage:runTopLevelLifecycles Completed in 16942ms
9362 verbose stack Error: sqlite3@5.0.0 install: `node-pre-gyp install --fallback-to-build`
9362 verbose stack Exit status 1
9362 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
9362 verbose stack     at EventEmitter.emit (events.js:315:20)
9362 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
9362 verbose stack     at ChildProcess.emit (events.js:315:20)
9362 verbose stack     at maybeClose (internal/child_process.js:1021:16)
9362 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
9363 verbose pkgid sqlite3@5.0.0
9364 verbose cwd /home/wojciech
9365 verbose Linux 5.4.0-40-generic
9366 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "gtfs-to-html" "-g"
9367 verbose node v12.18.4
9368 verbose npm  v6.14.6
9369 error code ELIFECYCLE
9370 error errno 1
9371 error sqlite3@5.0.0 install: `node-pre-gyp install --fallback-to-build`
9371 error Exit status 1
9372 error Failed at the sqlite3@5.0.0 install script.
9372 error This is probably not a problem with npm. There is likely additional logging output above.
9373 verbose exit [ 1, true ]
root@vps671012:/home/wojciech#
brendannee commented 4 years ago

This looks like an issue with sqlite3 being installed on Ubuntu.

This issue: https://github.com/mapbox/node-sqlite3/issues/1329 makes it sound like if you run:

npm install --build-from-source

it may work.

If that doesn't, check out some of the other issue threads related to this issue on the node-sqlite project: https://github.com/mapbox/node-sqlite3/issues?q=is%3Aissue+ubuntu+

wkulesza commented 4 years ago

@brendannee thanks for pointers. On Ubuntu 18.04 (clean install) i had to use nvm to install latest npm version (apt get install npm installed incorrect version) and indeed npm install --build-from-source gtfs-to-html -g did the trick.

Now i'm stuck with No trips found for route_id being printed to my tries to run it (both with stock config with bart gtfs and also my own gtfs zip file).

Does it mean i need to manually change examples/timetable.txt or should it work only using the gfts url in config.json ?

brendannee commented 4 years ago

You'll need to manually create a timetables.txt file based on the example one but using the correct route_ids and info for your feed.

Or, you can skip that step and GTFS-to-HTML will try to generate timetables for all route/direction/day combinations it can find.

wkulesza commented 3 years ago

For all those struggling with my error, this is what worked for me:

brendannee commented 3 years ago

Thanks for the notes - I updated the documentation to add this to the troubleshooting section: https://gtfstohtml.com/docs/quick-start