laravel composer 依赖安装报错现象分析

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了laravel composer 依赖安装报错现象分析相关的知识,希望对你有一定的参考价值。

Q&A1:安装composer依赖时报错:

总结:安装composer 依赖包时出现这个问题,原因在于配置文件中连接的数据库中没有将当前应用服务器加入到白名单中导致的;
事实上数据库配置改为内网时就不存在了;而且此时的依赖包也是安装成功的,而且已经进入到框架层进行检测了。
>> composer install

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package phpoffice/phpexcel is abandoned, you should avoid using it. Use phpoffice/phpspreadsheet instead.
Generating optimized autoload files
> IlluminateFoundationComposerScripts::postInstall
> php artisan optimize

In Connection.php line 664:

  SQLSTATE[28000] [1045] ip not in whitelist or in blacklist, client ip is xx  
  .93.198.5 (SQL: select * from `permissions` where `permissions`.`deleted` =  
   0)                                                                          

In Connector.php line 67:

  SQLSTATE[28000] [1045] ip not in whitelist or in blacklist, client ip is xx  
  .93.198.5                                                                

Q&A2: 缺乏composer.lock文件

在laravel框架中存在两个配置文件,composer.json, composer.lock,前者是
控制vender三方库的来源,后者是控制调用的三方库的来源。
Loading composer repositories with package information
Updating dependencies (including require-dev)

  [SeldJsonLintParsingException]                                                                    
  "https://composer.DOMAIN_NAME.com/repo/packagist/p/barryvdh/laravel-cors.json" does not contain valid  
   JSON                                                                                               
  Parse error on line 1:                                                                              

  ^                                                                                                   
  Expected one of: ‘STRING‘, ‘NUMBER‘, ‘NULL‘, ‘TRUE‘, ‘FALSE‘, ‘{‘, ‘[‘                              

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...

以上是关于laravel composer 依赖安装报错现象分析的主要内容,如果未能解决你的问题,请参考以下文章

laravel5.6安装问题 phpstudy php7.21+nginx安装后访问public/index.php报错 提示缺少文件 如图

使用composer安装laravel包而不更新依赖项[重复]

安装laravel时确保 /.composer/vendor/bin 在系统路径中啥意思

安装scount的es驱动,composer require tamayo/laravel-scout-elastic报错解决

composer安装Laravel5

laravel巧用composer