mhallin/graphql_ppx

Incompatibility with Node < v8.5.0

xtuc opened this issue · 1 comments

xtuc commented

I got the following error while trying to install the package:

/foo/node_modules/graphql_ppx/copyPlatformBinaryInPlace.js:41
    fs.copyFileSync(filename, 'ppx');
       ^
TypeError: fs.copyFileSync is not a function
    at Object.<anonymous> (/foo/node_modules/graphql_ppx/copyPlatformBinaryInPlace.js:41:8)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:383:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:496:3

I had Node v6.11.4, which doesn't support fs.copyFileSync (Added in: v8.5.0).

fs.copyFileSync(filename, 'ppx');

Since the error message isn't really helpful, I would suggest to either check the Node version or use some kind of polyfill.

@xtuc @mhallin said he would be happy to accept PRs that add copyFileSync polyfill