brenolf / polyjuice

A utility to convert JSHint and JSCS files into ESLint files and vice-versa
MIT License
275 stars 15 forks source link

yargs dependency is crashing polyjuice #81

Closed distributedlock closed 8 years ago

distributedlock commented 8 years ago

It seems there is an error in the yargs dependency. Tested this issue on Node v4, 5, 6, 6.1. Maybe an update to the latest version of yargs might resolve this?

Error log below:

➜  ~ polyjuice  
/usr/local/lib/node_modules/polyjuice/node_modules/yargs/lib/usage.js:243
      var e = epilog.replace(/\$0/g, yargs.$0)
                     ^

TypeError: epilog.replace is not a function
    at Object.self.help (/usr/local/lib/node_modules/polyjuice/node_modules/yargs/lib/usage.js:243:22)
    at Object.self.showHelp (/usr/local/lib/node_modules/polyjuice/node_modules/yargs/lib/usage.js:318:25)
    at Object.Argv.self.showHelp (/usr/local/lib/node_modules/polyjuice/node_modules/yargs/index.js:382:11)
    at Object.<anonymous> (/usr/local/lib/node_modules/polyjuice/lib/bin.js:59:9)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Function.Module.runMain (module.js:575:10)
brenolf commented 8 years ago

This is very weird, since running node lib/bin.js works fine. It is already using the latest version of yargs, I'm not sure what might be causing it. Thanks for the issue.

brenolf commented 8 years ago

Thing is, package.json gets parsed once it's deployed to npm and turns into an object, which triggers the error.

distributedlock commented 8 years ago

Working perfectly now. Thanks for the bug fix. Appreciate the quick response 👍 .