Question 1: Error Do not run Composer as root/super user!
1. Create a new user and password
useradd newname
passwd 123456
2. Switch to a new user account
su newname
After switching to the new user, you can perform the original operation and successfully complete the composer command.
Create a new user and user group, switch to the new user to execute the corresponding command
Append user to sudo user group
root@centos-system$ sudo usermod -a -G sudo userName
问题二:touch(): Unable to create file /home/composer/.composer/config.json because No such file or directory
Copy or move .composer under the root command to the user directory used to execute composer
sudo mv /root/.composer /home/user1/
Question 3: Could not read /home/user1/.composer/config.json
Authorize the directory
sudo chmod -r 777 /home/user1