0

I am trying to run the server using :

node server/index.js

But I am getting this :

SyntaxError: Unexpected token >
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 Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3

The index .js file is failing on :

db.each("SELECT name FROM sqlite_master WHERE type = 'table'", (err, data) => {
    tables.push(data.name);
});

Any idea what may be wrong ?

2

1 Answer 1

1

Try replacing

db.each("SELECT name FROM sqlite_master WHERE type = 'table'", (err, data) => {
tables.push(data.name);});

with

db.each("SELECT name FROM sqlite_master WHERE type = 'table'", function(err, data) {
tables.push(data.name);});

as it seems your node version is not supporting this syntax.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.