Composer php admin/setup.sh:第2行:$'\r';:找不到命令
尝试运行composer安装或composer更新时出错 我的环境是:VirtualBox、Vagrant、Centos7、PHP7.2 我已使用此方法安装composer:Composer php admin/setup.sh:第2行:$'\r';:找不到命令,composer-php,vagrant,centos7,php-7.2,Composer Php,Vagrant,Centos7,Php 7.2,尝试运行composer安装或composer更新时出错 我的环境是:VirtualBox、Vagrant、Centos7、PHP7.2 我已使用此方法安装composer: cd /var/www/html/<project folder> sudo yum install php-cli php-zip wget unzip php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" HASH
cd /var/www/html/<project folder>
sudo yum install php-cli php-zip wget unzip
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
HASH="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
sudo php composer-setup.php --install-dir=/usr/bin --filename=composer
谢谢你,谢谢你的帮助
[vagrant@localhost ci_blog]$ composer require moment/moment
Using version ^2.24 for moment/moment
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 4 installs, 0 updates, 0 removals
- Installing symfony/process (v3.4.33): Loading from cache
- Installing kriswallsmith/assetic (v1.4.0): Loading from cache
- Installing robloach/component-installer (0.2.3): Loading from cache
Plugin installation failed, rolling back
- Removing robloach/component-installer (0.2.3)
Installation failed, reverting ./composer.json to its original content.
[ErrorException]
include(/var/www/html/ci_blog/vendor/robloach/component-installer/src/ComponentInstaller/ComponentInstallerPlugin.p
hp): failed to open stream: No such file or directory
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...
[vagrant@localhost ci_blog]$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
Generated autoload files containing 625 classes
> CodeIgniter\ComposerScripts::postUpdate
> bash admin/setup.sh
admin/setup.sh: line 2: $'\r': command not found
cp: cannot create regular file ‘.git/hooks/pre-commit\r’: Protocol error
chmod: cannot access ‘.git/hooks/pre-commit\r’: No such file or directory
Script bash admin/setup.sh handling the post-update-cmd event returned with error code 1