If you are being promoted for FTP details when trying to add Wordpress plugins on your localhost then you can easily avoid this by using the alternate direct Wordpress upload method. All you need to do is open up the wp-config.php on your Wordpress installation and add the following line:-

When you refresh your upload/update page you will now not be prompted for the FTP credentials.