I have solved my problem with help from Peter@Peter Paul Kiefer in the last answer.
I was running this command:
sudo curl https://cli.pipedream.com/install | sh
But this was only running curl as sudo i needed to run this:
curl https://cli.pipedream.com/install | sudo sh
To run sh
as sudo not curl