Remove old image from folder using rm(path)

In my phoenix project, I have to unlink old image if a user uploads any new profile image to do that I have used rm(path) function as per the document https://hexdocs.pm/elixir/File.html but it is not working

The code used in my controller is as shown below:

rm("#{target_directory}/#{id}-profile.png")

But it gives me an error

== Compilation error in file
controllers/user_controller.ex:52: undefined function rm/1

Just to be clear, are you importing the File module?
If not, you would call it as File.rm/1