PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, January 17, 2022

[FIXED] Composer Could not find package jwt-auth

 January 17, 2022     composer-php, json, jwt-auth, php, symfony     No comments   

Issue

I'm trying to add jwt-auth to my Symfony project.

trying to execute the below command

$ composer require jwt-auth

getting these error

  [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`

Thanks in advance.


Solution

Doing:

composer require jwt-auth

Is equivalent to doing:

composer require lexik/jwt-authentication-bundle

In order to be able to use the short-hand version, you need to have Flex installed in your Symfony project. Basically, Flex is a Composer plugin to automate certain configuration tasks after a bundle is installed, like creating the configuration files, updating the .env file... Have a read here: https://symfony.com/doc/current/setup/flex.html

You can totally just use the second command if you don't want to install Flex in your Symfony project.

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.



Answered By - Magd Kudama
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing