Unable to install any packages

Hi all, I am new to R programming language.

I have been trying to install packages on my mac but failed. The error prompt is:

ld: warning: -pie being ignored. It is only used when linking a main executable
clang-4.0: error: unable to execute command: Segmentation fault: 11
clang-4.0: error: linker command failed due to signal (use -v to see invocation)

How can I resolve this issue? Thank you!

Can you post the complete error message you get?

Do you install the package through script or the program R studio?