I am having a strange issue, as my code is working fine in Ubuntu and Windows machines and is failing in a Centos server. I have the same node version 8.9.1 and the same npm 5.5.1 and the same sails 1.0.0.41 (globally and locally). Everything works except on my Centos machine where I get
const makeRequest = async () => {
^
SyntaxError: Unexpected token (
with an arrow pointing to the first paren. The only thing that I currently suspect is that my N version management has not properly updated node. Running node -v reports 8.9.1. Here is a simplified cut of the async code:
const makeRequest = async () => {
try{
const user = await sails.models.user.findOne({id: user_id});
return Promise.resolve(user);
}
catch(error){
sails.log.error('error getting data', error);
}
}
return makeRequest().then(out => {
return Promise.resolve(out);
});
Any suggestions on how to resolve this error?