Alireza Ghaffari
Alireza Ghaffari

Reputation: 1104

Connect-mongo Syntax Error: unexpected token =>

Hi I have the following error

node_modules/connect-mongo/src/index.js:29
unserialize: options.unserialize || (x => x),
^^

I have these versions:

[email protected]

[email protected]

[email protected]

[email protected]

Upvotes: 2

Views: 1138

Answers (1)

Ionică Bizău
Ionică Bizău

Reputation: 113365

Most probably you have an outdated version of Node.js.

The (x => x) is equivalent with function (x) { return x; } (it's called an arrow function).

Update Node.js to a version greater than 4.0.0.

Running the node process with the --harmony flag could solve the issue, but still updating the Node.js to a recent version is much better.

Upvotes: 2

Related Questions