项目中引入composer包

假如在云服务器上,项目根目录在 /data/shop,则

示例:

cd /data/shop
composer require haveyb/tiny-laravel

响应的结果可能会有两种:

 
1、第一种是直接require成功

示例:

#响应结果
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing haveyb/tiny-laravel (v1.0.0): Loading from cache
Writing lock file
Generating autoload files

 
 2、报错 Could not find a version of package

出现这个问题的原因是包的作者并没有打tag,这时我们可以执行命令:

composer require phalapi/qrcode @dev

也就是在后面添加一个 @dev,这时你会发现require成功,不再报错了。


 注意:

如果作者没有打tag,很有可能是包还没有完善稳定,就不太建议继续使用了,建议找其他的功能相似的包。


 

原文地址:https://www.haveyb.com/article/162 

发布了137 篇原创文章 · 获赞 174 · 访问量 255万+

猜你喜欢

转载自blog.csdn.net/m_nanle_xiaobudiu/article/details/104231606