Report this

What is the reason for this report?

async function Unexpected token after droplet resize

Posted on January 4, 2018

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

v8.9.1

Im using pm2



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Dark mode is coming soon.