inukshuk / sqleton

Visualize your SQLite database schema
GNU General Public License v3.0
110 stars 12 forks source link

SyntaxError: Unexpected token ... #1

Closed mlawren closed 8 years ago

mlawren commented 8 years ago

Attempting to run sqleton on Debian GNU/Linux testing distribution fails with the following error:

/usr/local/lib/node_modules/sqleton/index.js:75
  return tag('tr', tds.map(args => td(...args)).join(''))
                                      ^^^

SyntaxError: Unexpected token ...
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/sqleton/bin/sqleton:9:17)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

I don't know node/npm at all but here are I assume the relevant versions of the dependencies:

sqleton@1.2.0 /usr/local/lib/node_modules/sqleton
├── yargs@4.4.0 (decamelize@1.2.0, y18n@3.2.1, camelcase@2.1.1, window-size@0.2.0, require-main-filename@1.0.1, yargs-parser@2.2.0, lodash.assign@4.0.7, os-locale@1.4.0, cliui@3.1.2, string-width@1.0.1, pkg-conf@1.1.2, read-pkg-up@1.0.1)
└── sqlite3@3.1.3 (nan@2.2.1)
inukshuk commented 8 years ago

What's your 'node' version, i.e., the output of node -v?

I wrote this for Node 4+ but I might have been carried away with ES2015 features there -- it should be fairly easy to fix anyway.

Thanks for reporting!

mlawren commented 8 years ago

On Wed Apr 06, 2016 at 03:44:31AM -0700, Sylvester Keil wrote:

What's your 'node' version, i.e., the output of node -v?

v4.3.1

I wrote this for Node 4+ but I might have been carried away with ES2015 features there -- it's should be fairly easy to fix.

Thanks for reporting!

Thanks for open sourcing!

Mark Lawrence

inukshuk commented 8 years ago

OK I was a little bit too heavy on the new ES features there.

You should be able to work around this for now, by calling sqleton with the harmony flag. So you can do something like this:

# This fails on Node 4
$ sqleton -o db.pdf db.sqlite 

# You can call it like this to make it work
$ node --harmony <full/path/to/sqleton/bin/sqleton> -o db.pdf db.sqlite

I'll push a new release asap that does not have this problem. By the way, I'm still tuning a lot of parameters because the results vary greatly between databases (depending on how many tables and foreign key constraints there are) -- if you want to tweak the parameters yourself the best way, at the moment, is to produce a .dot file adjust the parameters and then run your preferred layouter on it.

inukshuk commented 8 years ago

Version 1.2.1 should work on Node 4.x without harmony flag.

mlawren commented 8 years ago

On Wed Apr 06, 2016 at 07:20:06AM -0700, Sylvester Keil wrote:

Version 1.2.1 should work on Node 4.x without harmony flag.

Good stuff - works well. Thanks for your quick and friendly response!

Mark Lawrence