braintree / braintree_node

Braintree Node.js library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
334 stars 104 forks source link

Issue with the rest spread operator (...) - unexpected token #181

Closed cosmin-novac closed 3 years ago

cosmin-novac commented 3 years ago

When I start my application I receive the following error:

node_modules\braintree\lib\braintree\util.js:277
W20201208-16:31:36.034(1)? (STDERR)   static zip(...arrays) {
W20201208-16:31:36.035(1)? (STDERR)              ^^^
W20201208-16:31:36.036(1)? (STDERR)
W20201208-16:31:36.037(1)? (STDERR) SyntaxError: Unexpected token ...

I read this might be due to missing babel dependencies, so I attempted to add the following to the project, but the problem persists:

babel-plugin-transform-es2015-destructuring,
babel-plugin-transform-object-rest-spread,
babel-preset-stage-0
crookedneighbor commented 3 years ago

What version of node are you using? The current version of the Braintree SDK requires Node v10 or higher.

cosmin-novac commented 3 years ago

Yes, thank you. I was using an older version of Node. Updating it fixed the issue.