Laravel 安装和开发环境:修改项目依赖为新的镜像地址

小畅 608 次浏览 0
HTML
  1. composer install
  2. Do not run Composer as root/super user! See https://getcomposer.org/root for details
  3. Loading composer repositories with package information
  4. Installing dependencies (including require-dev) from lock file
  5. Package operations: 32 installs, 0 updates, 0 removals
  6. - Installing fzaninotto/faker (v1.8.0): Downloading (failed)
  7. Downloading (failed)
  8. Downloading (failed)
  9. Failed, trying the next URL (0: The "https://dl.laravel-china.org/fzaninotto/faker/f72816b43e74063c8b10357394b6bba8cb1c10de.zip" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
  10. error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
  11. Failed to enable crypto
  12. failed to open stream: operation failed)Downloading (5%)^C
  13.  
  14. 原因:2019年7月24日,Laravel China宣布2个月后停用Laravel China中国全量镜像,推荐使用阿里云、腾讯、华为laravel镜像。
  15.  
  16. 解决方案:
  17.  
  18. 阿里云镜像
运行 复制 文本 高亮

1. 配置新镜像

首先配置你的新镜像为全局镜像:

Source Code
  1. $ composer config repo.packagist composer https://mirrors.aliyun.com/composer/
复制 文本 高亮

2. 刷新 composer.lock 文件

使用以下命令:

Source Code
  1. $ composer update nothing
复制 文本 高亮

或者:

Source Code
  1. $ composer update --lock
复制 文本 高亮

发表评论 取消回复
表情 图片 链接 代码

分享