planarnetwork/dtd2mysql

TypeError: Object.values is not a function

Closed this issue · 3 comments

Hi Linus! I think I need some hand holding to get this running for the first time.

I'm using mariadb and node v6.11.1
I've created a database user 'dtd2mysql' and checked that they can log in without a password. I've created the 'fares' database.

Here's the error I'm getting upon first run:

Extracting ~/downloads/RJFAF499.ZIP to /tmp/dtd/fares/
TypeError: Object.values is not a function
    at ImportFeedCommand.get fileArray [as fileArray] (/usr/local/lib/node_modules/dtd2mysql/dist/src/cli/ImportFeedCommand.js:37:23)
    at ImportFeedCommand.<anonymous> (/usr/local/lib/node_modules/dtd2mysql/dist/src/cli/ImportFeedCommand.js:64:37)
    at next (native)
    at /usr/local/lib/node_modules/dtd2mysql/dist/src/cli/ImportFeedCommand.js:13:71
    at __awaiter (/usr/local/lib/node_modules/dtd2mysql/dist/src/cli/ImportFeedCommand.js:9:12)
    at ImportFeedCommand.doImport (/usr/local/lib/node_modules/dtd2mysql/dist/src/cli/ImportFeedCommand.js:61:16)
    at ImportFeedCommand.<anonymous> (/usr/local/lib/node_modules/dtd2mysql/dist/src/cli/ImportFeedCommand.js:45:28)
    at next (native)
    at /usr/local/lib/node_modules/dtd2mysql/dist/src/cli/ImportFeedCommand.js:13:71
    at __awaiter (/usr/local/lib/node_modules/dtd2mysql/dist/src/cli/ImportFeedCommand.js:9:12)
    at ImportFeedCommand.run (/usr/local/lib/node_modules/dtd2mysql/dist/src/cli/ImportFeedCommand.js:43:16)
    at container.getCommand.then.c (/usr/local/lib/node_modules/dtd2mysql/dist/src/index.js:7:18)
    at process._tickCallback (internal/process/next_tick.js:109:7)
    at Module.runMain (module.js:606:11)
    at run (bootstrap_node.js:389:7)
    at startup (bootstrap_node.js:149:9)
Done

I'm not yet familiar with TypeScript and the error doesn't give me much of a clue as to whether the problem is with the db connection or elsewhere.

Any pointers much appreciated, cheers for making the project open!

Ah that's my mistake I should correct the node version in the package.json. It needs node.js 8.0 otherwise the Object.values method won't exist.

I've now updated the package.json to state that version 8.0.0 or higher is required. As a side note you might be interested in the gtfs branch that will turn the timetable data into GTFS format.

Thanks! That fixed that problem!