tmrudick / mta-turnstiles

node module and command line tool to parse MTA turnstile data
Other
3 stars 4 forks source link

Error when running app #1

Closed azilnik closed 9 years ago

azilnik commented 9 years ago

I have Node installed. I am trying to run this app on a URL, to see if it works. I keep getting an error with the trim() function.

.../turnstile.js:19 exits: line.shift().trim() ^ TypeError: Cannot call method 'trim' of undefined at parseLine (/Users/ari.zilnik/Hadoop/hdfs-testing/node_modules/mta-turnstiles/lib/streams/turnstile.js:19:27) at /Users/ari.zilnik/Hadoop/hdfs-testing/node_modules/mta-turnstiles/lib/streams/turnstile.js:49:5 at Array.forEach (native) at TurnstileStream._transform (/Users/ari.zilnik/Hadoop/hdfs-testing/node_modules/mta-turnstiles/lib/streams/turnstile.js:48:14) at TurnstileStream.Transform._read (_stream_transform.js:179:10) at TurnstileStream.Transform._write (_stream_transform.js:167:12) at doWrite (_stream_writable.js:225:10) at writeOrBuffer (_stream_writable.js:215:5) at TurnstileStream.Writable.write (_stream_writable.js:182:11) at Request.ondata (stream.js:51:26)

tmrudick commented 9 years ago

Hi! I just merged a PR which may fix this issue. Can you give it another shot?

Sushindhran commented 9 years ago

Same here.

/Personal/TurnstileData/server/node_modules/mta-turnstiles/lib/streams/turnstile.js:19
      exits: line.shift().trim()
                          ^
TypeError: Cannot call method 'trim' of undefined
    at parseLine (/Personal/TurnstileData/server/node_modules/mta-turnstiles/lib/streams/turnstile.js:19:27)
    at /Personal/TurnstileData/server/node_modules/mta-turnstiles/lib/streams/turnstile.js:49:5
    at Array.forEach (native)
    at TurnstileStream._transform (/Personal/TurnstileData/server/node_modules/mta-turnstiles/lib/streams/turnstile.js:48:14)
    at TurnstileStream.Transform._read (_stream_transform.js:179:10)
    at TurnstileStream.Transform._write (_stream_transform.js:167:12)
    at doWrite (_stream_writable.js:226:10)
    at writeOrBuffer (_stream_writable.js:216:5)
    at TurnstileStream.Writable.write (_stream_writable.js:183:11)
    at Request.ondata (stream.js:51:26)```
tmrudick commented 9 years ago

I just updated the package on npm. Looks like it is fixed now.

If not, can you give me the command you are running this with?

Sushindhran commented 9 years ago

Works like a charm. Thanks!