yxliang01 / git-pull-hook

A npm(nodejs) module allows you to add prepull and postpull hook
MIT License
1 stars 0 forks source link

SyntaxError: Use of const in strict mode. #1

Open temple opened 7 years ago

temple commented 7 years ago

When executing in Ubuntu 14.04 LTS using legacy node js v0.10.25, it says:

$ gitp

/usr/local/lib/node_modules/git-pull-hook/node_modules/inquirer/node_modules/figures/index.js:2
const escapeStringRegexp = require('escape-string-regexp');
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/git-pull-hook/node_modules/inquirer/lib/objects/separator.js:3:15)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

Is there any patch available?

temple commented 7 years ago

It seems to be a node issue

http://stackoverflow.com/questions/22603078/syntaxerror-use-of-const-in-strict-mode

temple commented 7 years ago

And it seems to be a workaround:

http://stackoverflow.com/questions/8191459/how-do-i-update-node-js/19584407#19584407

yxliang01 commented 7 years ago

Thank you for reporting. Will look into this next week!

yxliang01 commented 7 years ago

So, this is caused by the fact that nodejs 0.10 doesn't support const. I have submitted issues at https://github.com/sindresorhus/figures/issues/22 . I am not sure whether other dependency packages have this problem though.

Meanwhile, why would you use nodejs 0.10? It's so old.

yxliang01 commented 7 years ago

So, the issue I opened is closed. Basically, it's a won't fix there. I am considering to try packing tools like webpack (not sure whether it works for nodejs modules though). So that, all those upstream issues will be solved automatically.