To fix ‘Error: Couldn’t find preset "es2015" relative to directory "/Users/username"’ with JavaScript, we install the Babel preset package.
To install it, we run
npm install babel-cli babel-preset-es2015
to install the Babel packages to clear the error.