Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to install after update #5

Open
wkulesza opened this issue Oct 16, 2021 · 12 comments
Open

unable to install after update #5

wkulesza opened this issue Oct 16, 2021 · 12 comments

Comments

@wkulesza
Copy link
Contributor

wkulesza commented Oct 16, 2021

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

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

@wkulesza
Copy link
Contributor Author

wkulesza commented Oct 17, 2021

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

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

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

@brendannee
Copy link
Member

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

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

brendannee commented Oct 18, 2021

  • 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.
  • The config property is now called "locale" instead of "languageCode"
  • 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!

@wkulesza
Copy link
Contributor Author

wkulesza commented Oct 19, 2021 via email

@wkulesza
Copy link
Contributor Author

@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
Copy link
Contributor Author

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

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

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

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

No branches or pull requests

2 participants