async function Unexpected token after droplet resize

January 4, 2018 119 views
Node.js Ubuntu 16.04

I resized my droplet and after that my node server doesn't recognize the keyword async for the function definition as if the Node.js version was wrong

 async function getGrapsh(results){
0|index    |       ^^^^^^^^
0|index    | 
0|index    | SyntaxError: Unexpected token function

but when i type node -v in the terminal i get


Im using pm2

1 Answer

I found the problem, it had to do with the pm2 startup settings. To reset that you can run the command :
pm2 unstartup

and then run the command that is suggested

Have another answer? Share your knowledge.