BlinkTagInc / transit-departures-widget

Build a realtime transit departures widget from GTFS and GTFS-Realtime Data.
MIT License
21 stars 5 forks source link

unable to install after update #5

Open wkulesza opened 2 years ago

wkulesza commented 2 years ago

Hi, after updating (and even now when git cloning 0.1.4 tag), i'm getting this error after clone, edit of config.json and running npm install:

root@vpsXXXXX:/home/wojciech/transit-arrivals-widget# npm install transit-arrivals-widget --unsafe-perm --allow-root -g
npm ERR! code 128
npm ERR! Command failed: git clone --mirror -q https://git@github.com/mapbox/node-sqlite3.git /root/.npm/_cacache/tmp/git-clone-f290504d/.git
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-f290504d/.git'
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-10-16T19_30_05_191Z-debug.log

Please help. When trying to git clone and then npm install as normal user, im getting errors as normal user has access to node v8.10.0 only and other errors popup like: Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/transit-arrivals-widget

brendannee commented 2 years ago

Try the version 1.0.1 that I just released and see if that solves the issue.

wkulesza commented 2 years ago

I just tried and now getting:

root@srv1:/opt/transit-arrivals-widget# npm install transit-arrivals-widget --unsafe-perm --allow-root -g
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code 127
npm ERR! path /root/.nvm/versions/node/v16.11.1/lib/node_modules/transit-arrivals-widget/node_modules/sqlite3
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! sh: node-pre-gyp: command not found

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-10-17T21_01_21_525Z-debug.log
root@srv1:/opt/transit-arrivals-widget# transit-arrivals-widget
transit-arrivals-widget: command not found

using: nvm 0.39.0 npm 8.1.0 node v16.11.1

edit: switched to node 14.18.1 and it went through.

brendannee commented 2 years ago

Thanks for trying this.

The sqlite3 library in use relies on an older version of node-pre-gyp which hasn't added support for node 16 yet. I'll release a new version once all of these dependencies get updates.

The issue could actually be the version of npm - I see other people mentioning issues with npm > 6, so trying node 16 with npm 6 may work.

wkulesza commented 2 years ago

OK cool. I'm missing one more string to translate. Initial search box still says in english: Search by stop name or id

brendannee commented 2 years ago

Good catch. I found 3 strings missing and moved them to the template:

https://github.com/BlinkTagInc/transit-arrivals-widget/blob/master/views/widget/content/content_pl.pug#L15 "Search by stop name or id" "all"

https://github.com/BlinkTagInc/transit-arrivals-widget/blob/master/views/widget/content/content_pl.pug#L48 "min" (abbreviation of "minutes")

wkulesza commented 2 years ago

OK, will translate. Does this string need to be moved to template too ? "To" - in the listing of upcoming arrivals, next to route number, before trip headsign ?

It is still not-stable for me, as sometimes, there's no arrivals presented for a trip that is correct (i.e. I can see it in other gtfs-rt consuming apps) but here, i need to refresh whole page to see the result. The only issue I can see in console is (this displays in polish, so translating it to english): Color expected but found "#null". Error processing values for 'background-color'. Declaration abandoned. Color expected but found "#null". Error processing value for "color". Declaration abandoned.

brendannee commented 2 years ago

For the issue you mentioned with missing arrivals, can you send me your GTFS and GTFS-RT feed so I can troubleshoot? And an example of a stop which isn't showing up as expected? Thanks!

wkulesza commented 2 years ago

Hi, great work. I had to remove my fork and re-fork to provide PR, but was able to add the missing translation. It will make sense to comine that widget with gtfs-to-html one day.. Will share the urls on slack.

pon., 18 paź 2021 o 19:51 Brendan Nee @.***> napisał(a):

  • I solved the issue you found with console warnings due to routes not having colors set
  • I moved all translations into locales files within the locales folder. https://github.com/BlinkTagInc/transit-arrivals-widget/tree/master/locales
  • this will make it much easier to keep things in sync.
  • You'll see in pl.json that there are a few additional strings which need translations: "Invalid stop ID", "min", and "To {{headsign}}". If you want to add these via PR, or just reply with what they should be that would be great.

For the issue you mentioned with missing arrivals, can you send me your GTFS and GTFS-RT feed so I can troubleshoot? And an example of a stop which isn't showing up as expected? Thanks!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BlinkTagInc/transit-arrivals-widget/issues/5#issuecomment-946016736, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHXUGDW4YUF5BWLODMK4J3UHRNA3ANCNFSM5GD6QXRQ .

-- Wojciech Kulesza

Właściciel / Owner

goEuropa Polska Wojciech Kulesza +48616248682 @.*** www.goeuropa.eu ul. 28 Czerwca 1956r nr 400 Kiedy przyjedzie autobus? Sprawdż na www.kiedybus.pl https://www.kiedybus.pl/

wkulesza commented 2 years ago

@brendannee see http://pksonline.pl/przyjazdy/?stop_id=POZTA02 sometimes on the first load it doesn't show any arrivals and i need to refresh the page to see something.

wkulesza commented 2 years ago

I tried to git pull the newest version and run transit-arrivals-widget and got this toward the end of processing:

 Generating Transit Arrivals Widget HTML
Error: views/widget/widget.pug:4
    2|   .card.mx-auto.my-5
    3|     .card-body
  > 4|       h2= __('Realtime Arrivals')
    5|       .form-group
    6|         .btn-group.btn-group-toggle(data-toggle="buttons")
    7|           label.btn.btn-primary.active

__ is not a function
[  Error: views/widget/widget.pug:4
      2|   .card.mx-auto.my-5
      3|     .card-body
    > 4|       h2= __('Realtime Arrivals')
      5|       .form-group
      6|         .btn-group.btn-group-toggle(data-toggle="buttons")
      7|           label.btn.btn-primary.active

  __ is not a function
] {
  path: 'views/widget/widget.pug'
brendannee commented 2 years ago

Thanks for sharing the link to the implementation. I'll try it at various times to see if I notice the same issue with it not showing times on first load. When that does happen, what does it show? If you notice it happening again, can you check the JS console and let me know if there are any errors logged?

As for the __ is not a function issue, make sure you run npm install after pulling the newest version - it adds the i18n library and passes the __ function to the pug template here: https://github.com/BlinkTagInc/transit-arrivals-widget/blob/master/lib/utils.js#L191

wkulesza commented 2 years ago

When i'm selecting route, direction and then stop (that i know has arrival and departure real-time info - checking it paralell with Trransitclock deployment) there's nothing in the console and it looks empty - http://prntscr.com/1xktnfl When i refresh page with f5, it displays departure - http://prntscr.com/1xkton2 Feed is valid, but has route colours that are not contrasting enough with route text color.

In regard to the npm - i'm using this command before issueing transit-arrivals-widget: npm install transit-arrivals-widget --unsafe-perm --allow-root -g

Without npm install, issuing transit-arrivals-widget says: command not found