0

我正在尝试添加jwt-auth到我的 Symfony 项目中。

尝试执行以下命令

$ composer require jwt-auth

收到这些错误

  [InvalidArgumentException]
  Could not find package jwt-auth.
    Did you mean one of these?
      tymon/jwt-auth
      tuupola/slim-jwt-auth
      auth0/jwt-auth-bundle
      admad/cakephp-jwt-auth
      dmkit/phalcon-jwt-auth`

提前致谢。

4

1 回答 1

4

正在做:

composer require jwt-auth

相当于做:

composer require lexik/jwt-authentication-bundle

为了能够使用简写版本,你需要在你的 Symfony 项目中安装 Flex。基本上,Flex 是一个 Composer 插件,用于在安装捆绑包后自动执行某些配置任务,例如创建配置文件、更新.env文件......在这里阅读:https ://symfony.com/doc/current/setup/flex .html

如果您不想在 Symfony 项目中安装 Flex,您完全可以只使用第二个命令。

The currently supported recipes are all available here: https://github.com/symfony/recipes. As you can see here: https://github.com/symfony/recipes/blob/master/lexik/jwt-authentication-bundle/2.5/manifest.json#L8 lexik/jwt-authentication-bundle can be automatically installed by using it's alias: jwt-auth.

于 2019-01-28T09:11:26.083 回答