Hello dianefrommalibu,
You'll want to start by opening Disk Utility and running First Aid to see if is able to correct the problem on the hard drive. Here's those steps: How to repair a Mac disk with Disk Utility
If you have any external hard drives or storage devices connected to the computer, disconnect them while you're attempting the software installation.
You can also try starting the computer in safe mode to see if the software installation works there.
How to use safe mode on your Mac
If the hard drive is unable to be repaired with First Aid, or you're still unable to install the software, we'd recommend contacting Apple for assistance: Get Support
Cheers!