Mac | 安装 Composer

2020-09-14  本文已影响0人  青椒辣不辣

在使用 PHP 对Markdown 文件来生成最终的 HTML 文件
安装依赖时报错

$ composer install
-bash: composer: command not found

安装 composer

$ curl -sS https://getcomposer.org/installer | php
All settings correct for using Composer
Downloading...

Composer (version 1.10.13) successfully installed to: /Users/jintian/Downloads/Material-Design-Chinese-2/build/composer.phar
Use it: php composer.phar

然后再次尝试

$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 3 installs, 0 updates, 0 removals
  - Installing erusev/parsedown (1.8.0-beta-4): Downloading (failed)       
Downloading (failed)       
Downloading (failed)    Failed to download erusev/parsedown from dist: The "https://files.phpcomposer.com/files/erusev/parsedown/1f69f7e69797104e73fdceaae22a4b4e3978f0a4.zip" file could not be downloaded: failed to open stream: Connection refused
    Now trying to download from source
  - Installing erusev/parsedown (1.8.0-beta-4): Cloning 1f69f7e697 from cache
  - Installing grinderspro/directory-manipulator (1.0.1): Downloading (failed)       
Downloading (failed)       
Downloading (failed)    Failed to download grinderspro/directory-manipulator from dist: The "https://files.phpcomposer.com/files/grinderspro/directory-manipulator/00a4255fcd2ba77b238380f41d4f7a17f96aad06.zip" file could not be downloaded: failed to open stream: Connection refused
    Now trying to download from source
  - Installing grinderspro/directory-manipulator (1.0.1): Cloning 00a4255fcd from cache
  - Installing komalbarun/dirpy (0.0.4): Downloading (100%)         
Generating autoload files

然后使用后边的php命令即可
搞定!

上一篇 下一篇

猜你喜欢

热点阅读