Maybe the package you are trying to install is not published on CRAN (the default package source). It is very common for packages to be only available as source code in other repositories like GitHub for example.
To give you any specific advice we would need more information, like the package name, the command you are using to install it and the complete error message you get.