Thursday, 13 October 2016

Promise is not defined Ubuntu

If you get the "promise is not defined" error when you try to build a js promise on Ubuntu, then check the following:

Check your node version
-> nodejs -v

If it's less than version 6.xx then upgrade it
First remove the old version
-> sudo apt-get remove nodejs

Then install the newer version with the following two commands as seen here
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs