admin / setup.sh:第2行:$'\ r':找不到命令

尝试运行composer安装或composer更新时出现错误。

我的环境是:VirtualBox,Vagrant,Centos7,Php 7.2

我已经使用这种方法来安装作曲家:

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>]...

我也在Google中查找了解决方案,但是没有什么看起来像是这个错误。

[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

谢谢,感谢所有帮助。

bbsoft123 回答:admin / setup.sh:第2行:$'\ r':找不到命令

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3145953.html

大家都在问