AriaMinaei / pretty-error

See node.js errors with less clutter
MIT License
1.52k stars 48 forks source link

'color': 'none' still applies ansi codes #26

Closed reggi closed 9 years ago

reggi commented 9 years ago
"Error\u001b[0m:\u001b[0m \u001b[0mSome error message\u001b[0m\n\u001b[0m    \u001b[0mat\u001b[0m Object.<anonymous>\u001b[0m (/Users/thomas/Desktop/node-reggi/z-multi-line.js:89:9)\u001b[0m\n\u001b[0m    \u001b[0mat\u001b[0m Module._compile\u001b[0m (module.js:430:26)\u001b[0m\n\u001b[0m    \u001b[0mat\u001b[0m Object.Module._extensions..js\u001b[0m (module.js:448:10)\u001b[0m\n\u001b[0m    \u001b[0mat\u001b[0m Module.load\u001b[0m (module.js:355:32)\u001b[0m\n\u001b[0m    \u001b[0mat\u001b[0m Function.Module._load\u001b[0m (module.js:310:12)\u001b[0m\n\u001b[0m    \u001b[0mat\u001b[0m Function.Module.runMain\u001b[0m (module.js:471:10)\u001b[0m\n\u001b[0m    \u001b[0mat\u001b[0m startup\u001b[0m (node.js:117:18)\u001b[0m\n\u001b[0m    \u001b[0mat\u001b[0m \u001b[0mnode.js:953:3\u001b[0m\n\u001b[0m"

I can use chalk.stripColor(string) to remove them. Didn't expect ansi codes when color wasn't applied.

reggi commented 9 years ago

Just came across pe.withoutColors() however I get this error when I use it:

pe.withoutColors()
   ^
TypeError: pe.withoutColors is not a function
AriaMinaei commented 9 years ago

TypeError: pe.withoutColors is not a function

Try updating to the latest version.