Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with spread operator #200

Closed
dland512 opened this issue Sep 8, 2017 · 3 comments
Closed

Issue with spread operator #200

dland512 opened this issue Sep 8, 2017 · 3 comments

Comments

@dland512
Copy link
Contributor

dland512 commented Sep 8, 2017

I'm getting this error on Ubuntu:

# ./node_modules/.bin/electron-rebuild 

/home/root/test/node_modules/electron-rebuild/lib/src/rebuild.js:73
                depKeys.push(...Object.keys(rootPackageJson.dependencies || {}));
                             ^^^

SyntaxError: Unexpected token ...
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Module._extensions..js (module.js:417:10)
    at Object.require.extensions.(anonymous function) [as .js] (/home/root/test/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/root/test/node_modules/electron-rebuild/src/cli.ts:9:1)
    at Module._compile (module.js:410:26)

Seems to be choking on the spread operator. Does electron-rebuild itself run under electron's node or the system's node? I'm guessing the system's node, which at version 4.2.6 can't handle the spread operator. Does that sound right? I can't necessarily upgrade it.

Here is my environment info:

Ubuntu: 16.04, ARMv7
system node: v4.2.6
npm: 3.5.2
electron: v1.4.16
electron node: 6.5.0

It works fine in my dev environment, which is running node 6.11.0.

@dland512
Copy link
Contributor Author

dland512 commented Sep 9, 2017

FYI, the problem did seem to be the fact that my system node, which as at v4.2.6, wasn't new enough to support the spread operator. Once I upgraded to v6.5.0 the rebuild worked fine.

@malept
Copy link
Member

malept commented Sep 9, 2017

Thanks for filing an issue, but according to https://github.com/electron/electron-rebuild/blob/dbd5b278a7e435b7dd7ca7676388c550c1ced3a6/package.json#L30-L32 the minimum Node version for electron-rebuild is Node 6.

@malept malept closed this as completed Sep 9, 2017
@dland512
Copy link
Contributor Author

dland512 commented Sep 9, 2017

Checkout pull request to update docs with this info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants