TypeError: undefined is not a function
Looks like ansimd has stopped working because of changes in marked or modules used by marked.
var md = require('ansimd') undefined md("Hello World!") TypeError: undefined is not a function Please report this to https://github.com/chjj/marked. at InlineLexer.output (/Users/gauravlahoti/Desktop/node_modules/ansimd/node_modules/marked/lib/marked.js:685:28) at Parser.tok (/Users/gauravlahoti/Desktop/node_modules/ansimd/node_modules/marked/lib/marked.js:1075:50) at Parser.parse (/Users/gauravlahoti/Desktop/node_modules/ansimd/node_modules/marked/lib/marked.js:935:17) at Function.Parser.parse (/Users/gauravlahoti/Desktop/node_modules/ansimd/node_modules/marked/lib/marked.js:922:17) at marked (/Users/gauravlahoti/Desktop/node_modules/ansimd/node_modules/marked/lib/marked.js:1218:19) at render (/Users/gauravlahoti/Desktop/node_modules/ansimd/index.js:21:13) at repl:1:1 at REPLServer.defaultEval (repl.js:132:27) at bound (domain.js:254:14) at REPLServer.runBound as eval
Same here, following the README's example:
ansimd foo.md
/usr/local/lib/node_modules/ansimd/node_modules/marked/lib/marked.js:1226
throw e;
^
TypeError: undefined is not a function
Please report this to https://github.com/chjj/marked.
at InlineLexer.output (/usr/local/lib/node_modules/ansimd/node_modules/marked/lib/marked.js:685:28)
at Parser.tok (/usr/local/lib/node_modules/ansimd/node_modules/marked/lib/marked.js:1075:50)
at Parser.parse (/usr/local/lib/node_modules/ansimd/node_modules/marked/lib/marked.js:935:17)
at Function.Parser.parse (/usr/local/lib/node_modules/ansimd/node_modules/marked/lib/marked.js:922:17)
at marked (/usr/local/lib/node_modules/ansimd/node_modules/marked/lib/marked.js:1218:19)
at render (/usr/local/lib/node_modules/ansimd/index.js:21:13)
at Object.<anonymous> (/usr/local/lib/node_modules/ansimd/cli.js:14:13)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
Fixed :+1: Don't know if it's worth leaving a comment to the marked repo that they broke compatibility? :-/
Thanks a ton mate. I hope the request gets merged soon.
Looking at the change, it looks like the marked repo moved onto a better practice. The developers knew they will break dependent code. Fixing ansimd looks like a better approach.
Agreed. And you're welcome :-)