zgulde / markdown-to-anki

Write anki flashcards in markdown
42 stars 4 forks source link

Error when converting #1

Closed hhzl closed 6 years ago

hhzl commented 6 years ago

Hello

I understand that there is no release yet. I got this error

$ markdown-to-anki flashcards.md
/usr/lib/node_modules/markdown-to-anki/markdown-to-anki:56
)
^
SyntaxError: Unexpected token )
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3
user8@user8-Latitude-E6410:~/Documents/markdown2anki$ gedit /usr/lib/node_modules/markdown-to-anki/markdown-to-anki

A suggestion: https://github.com/ewnd9/anki-apkg-export could be used to directly generate an apkg file.

zgulde commented 6 years ago

Thanks for the feedback!

It looks like that error is node having trouble parsing the javascript I wrote. Are you running an older version of node by chance? (I.e. what does node --version output?)

IIRC, trailing commas in function arguments are a fairly new feature, so this package would probably break on older node versions before that syntax is supported.

hhzl commented 6 years ago

Thank you for the feedback. Yes, my node version is old

    node --version
    v6.9.2

I'll use another installation.

BTW other projects dealing with markdown to anki or a similar short hand notation are

hhzl commented 6 years ago

It works fine with node v8.9.4