You can't.
In SSJS you can use the print("") function to output information to the server console. If you want to send an alert() to a browser user, you need to use clientside javascript.
(you can of course show the clientside alert conditionally based on a serverside variable)
Mark