I have solved my problem with help from @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
I don't see where you use sudo.
Perhaps it helps if you try:
curl https://cli.pipedream.com/install > /tmp/sd_insta.sh && \
sudo sh /tmp/sd_insta.sh
In your configuration: Even if you call the curl command with sudo that command pipes the output to a shell command which is not called with a sudo. And I expect the shell call will do the copy ...
First this to do if find out which user the program is running under.
Simplest way is to use
ps aux | less
Use the cursor keys to scroll up and down the list and once the job has been found use 'q' to return to the command line. Note the user is in the first column.
You then need to give that user permission to use the GPIO pins by becoming a member of one ...