I npm installed the node-term-ui package, but I keep getting “Unexpected string” errors, then I noticed the syntax in the files looks different, and realized it’s CoffeeScript which I’ve never used before.
How do I make it work?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
zeMirco’s answer is correct, but let me add more info: What
node-term-uiis doing is very, very unusual. The author has setmainin theirpackage.jsonto point to a.coffeefile, rather than compiling that file to a.jsfile. They also haven’t noted this in their README. I see that there’s now discussion about this at https://github.com/jocafa/node-term-ui/issues/2.The need for a
.jsfile may not have occurred to the author because, if you’re running a.coffeefile, you canrequireother.coffeefiles. In fact, all you need to require.coffeefiles directly is to require thecoffee-scriptmodule first. So what you could do in your JS file is:Be sure to add
coffee-scriptas a project dependency first.I hope the author will modify the library so that CoffeeScript isn’t required to use it, but that workaround should be easier than zeMirco’s solution of compiling the module manually.