如何正确安装Deployer?解决mv命令提示文件不存在的问题
mv: cannot stat错误 Let's fix this issue and get Deployer set up properly. The error you're hitting (mv: cannot stat 'deployer.phar': No such file or directory) typically stems from two main problems: either your initial download failed, or you're trying to move a file that doesn't exist in your current directory. Also, I spotted a typo in your target path that would cause issues even if the file was present—let's go through the correct installation steps step by step:
1. Verify the download was successful
First, check if the deployer.phar file actually exists in your current directory:
ls
If you don't see deployer.phar listed, the download didn't work. Try re-downloading it with verbose output to diagnose any issues:
curl -LOv https://deployer.org/deployer.phar
If curl still fails, you can use wget as an alternative:
wget https://deployer.org/deployer.phar
Once you see deployer.phar in your directory list, move to the next step.
2. Correctly move and set up the executable
You had a typo in your target path (/usr/usr/local/bin/dep has an extra usr/). The standard system-wide executable path is /usr/local/bin. Here's the correct command, which requires admin privileges (hence sudo):
sudo mv deployer.phar /usr/local/bin/dep
Next, make sure the file has executable permissions so you can run it from anywhere:
sudo chmod +x /usr/local/bin/dep
3. Verify the installation worked
To confirm Deployer is installed correctly, run:
dep --version
If you see the version number printed out, you're all set to use Deployer!
Troubleshooting extra tips
- If you downloaded
deployer.pharto a different directory (like~/Downloads), navigate there first withcd ~/Downloadsbefore running themvcommand, or use the full file path:sudo mv ~/Downloads/deployer.phar /usr/local/bin/dep - If you get a "permission denied" error when moving, that's exactly why we use
sudo—it grants the necessary rights to write to/usr/local/bin.
内容的提问来源于stack exchange,提问作者AzafoCossa

