2021-07-14に投稿

lcobucci/jwt を Composer でインストールしようとしたら Your requirements could not be resolved to an installable set of packages. のエラーメッセージ

lcobucci/jwt を Composer でインストールしようとしたら以下のエラーメッセージが表示されました。

> composer require
Search for a package: 
./composer.json has been updated
Running composer update 
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires lcobucci/jwt 4.1.4 -> satisfiable by lcobucci/jwt[4.1.4].
    - lcobucci/jwt 4.1.4 requires ext-sodium * -> it is missing from your system. Install or enable PHP's sodium extension.    

To enable extensions, verify that they are enabled in your .ini files:
    - PATH\TO\xampp\php\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Installation failed, reverting ./composer.json to its original content.

XAMPP (PHP 7.4.3) に ext-sodium の拡張機能がない、と。 Docker を使っても良いのですが、今回はサクッと試したいだけなのでもう少し見てみます。試しに php.ini を確認すると

;extension=soap
;extension=sockets
;extension=sodium
;extension=sqlite3
;extension=tidy
;extension=xmlrpc
;extension=xsl

何かそれらしきものがコメントアウトされているのを発見。

;extension=soap
;extension=sockets
extension=sodium
;extension=sqlite3
;extension=tidy
;extension=xmlrpc
;extension=xsl

コメントアウトを外し、 XAMPP のコントロールパネルから Apache を再起動。

それから再度 Composer でインストールをかけると、正常に完了しました。

参考

Originally published at labor.ewigleere.net
ツイッターでシェア
みんなに共有、忘れないようにメモ

arm-band

フロントエンド・バックエンド・サーバエンジニア。LAMPやNodeからWP、Gulpを使ってejs,Scss,JSのコーディングまで一通り。たまにRasPiで遊んだり、趣味で開発したり。

Crieitは誰でも投稿できるサービスです。 是非記事の投稿をお願いします。どんな軽い内容でも投稿できます。

また、「こんな記事が読みたいけど見つからない!」という方は是非記事投稿リクエストボードへ!

有料記事を販売できるようになりました!

こじんまりと作業ログやメモ、進捗を書き残しておきたい方はボード機能をご利用ください。
ボードとは?

コメント