1

Trying to install ramsey/uuid and I get the following error.

jay@dev:~/Dev/images$ composer require ramsey/uuid
Using version ^4.7 for ramsey/uuid
./composer.json has been created
Running composer update ramsey/uuid
Loading composer repositories with package information
Updating dependencies
Lock file operations: 3 installs, 0 updates, 0 removals
  - Locking brick/math (0.10.2)
  - Locking ramsey/collection (2.0.0)
  - Locking ramsey/uuid (4.7.3)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 3 installs, 0 updates, 0 removals
  - Downloading ramsey/collection (2.0.0)
  - Downloading brick/math (0.10.2)
  - Downloading ramsey/uuid (4.7.3)
PHP Fatal error:  Uncaught Error: Class "Normalizer" not found in /usr/share/php                                                                                                                                                                             /Symfony/Component/Console/Helper/Helper.php:65
Stack trace:
#0 /usr/share/php/Symfony/Component/Console/Helper/ProgressBar.php(383): Symfony                                                                                                                                                                             \Component\Console\Helper\Helper::width()
#1 /usr/share/php/Symfony/Component/Console/Helper/ProgressBar.php(322): Symfony                                                                                                                                                                             \Component\Console\Helper\ProgressBar->setMaxSteps()
#2 /usr/share/php/Composer/Util/Loop.php(89): Symfony\Component\Console\Helper\P                                                                                                                                                                             rogressBar->start()
#3 /usr/share/php/Composer/Installer/InstallationManager.php(497): Composer\Util                                                                                                                                                                             \Loop->wait()
#4 /usr/share/php/Composer/Installer/InstallationManager.php(362): Composer\Inst                                                                                                                                                                             aller\InstallationManager->waitOnPromises()
#5 /usr/share/php/Composer/Installer/InstallationManager.php(282): Composer\Inst                                                                                                                                                                             aller\InstallationManager->downloadAndExecuteBatch()
#6 /usr/share/php/Composer/Installer.php(754): Composer\Installer\InstallationMa                                                                                                                                                                             nager->execute()
#7 /usr/share/php/Composer/Installer.php(583): Composer\Installer->doInstall()
#8 /usr/share/php/Composer/Installer.php(279): Composer\Installer->doUpdate()
#9 /usr/share/php/Composer/Command/RequireCommand.php(430): Composer\Installer->                                                                                                                                                                             run()
#10 /usr/share/php/Composer/Command/RequireCommand.php(285): Composer\Command\Re                                                                                                                                                                             quireCommand->doUpdate()
#11 /usr/share/php/Symfony/Component/Console/Command/Command.php(298): Composer\                                                                                                                                                                             Command\RequireCommand->execute()
#12 /usr/share/php/Symfony/Component/Console/Application.php(1015): Symfony\Comp                                                                                                                                                                             onent\Console\Command\Command->run()
#13 /usr/share/php/Symfony/Component/Console/Application.php(299): Symfony\Compo                                                                                                                                                                             nent\Console\Application->doRunCommand()
#14 /usr/share/php/Composer/Console/Application.php(336): Symfony\Component\Cons                                                                                                                                                                             ole\Application->doRun()
#15 /usr/share/php/Symfony/Component/Console/Application.php(171): Composer\Cons                                                                                                                                                                             ole\Application->doRun()
#16 /usr/share/php/Composer/Console/Application.php(131): Symfony\Component\Cons                                                                                                                                                                             ole\Application->run()
#17 /usr/bin/composer(84): Composer\Console\Application->run()
#18 {main}
  thrown in /usr/share/php/Symfony/Component/Console/Helper/Helper.php on line 6                                                                                                                                                                             5

Fatal error: Uncaught Error: Class "Normalizer" not found in /usr/share/php/Symf                                                                                                                                                                             ony/Component/Console/Helper/Helper.php:65
Stack trace:
#0 /usr/share/php/Symfony/Component/Console/Helper/ProgressBar.php(383): Symfony                                                                                                                                                                             \Component\Console\Helper\Helper::width()
#1 /usr/share/php/Symfony/Component/Console/Helper/ProgressBar.php(322): Symfony                                                                                                                                                                             \Component\Console\Helper\ProgressBar->setMaxSteps()
#2 /usr/share/php/Composer/Util/Loop.php(89): Symfony\Component\Console\Helper\P                                                                                                                                                                             rogressBar->start()
#3 /usr/share/php/Composer/Installer/InstallationManager.php(497): Composer\Util                                                                                                                                                                             \Loop->wait()
#4 /usr/share/php/Composer/Installer/InstallationManager.php(362): Composer\Inst                                                                                                                                                                             aller\InstallationManager->waitOnPromises()
#5 /usr/share/php/Composer/Installer/InstallationManager.php(282): Composer\Inst                                                                                                                                                                             aller\InstallationManager->downloadAndExecuteBatch()
#6 /usr/share/php/Composer/Installer.php(754): Composer\Installer\InstallationMa                                                                                                                                                                             nager->execute()
#7 /usr/share/php/Composer/Installer.php(583): Composer\Installer->doInstall()
#8 /usr/share/php/Composer/Installer.php(279): Composer\Installer->doUpdate()
#9 /usr/share/php/Composer/Command/RequireCommand.php(430): Composer\Installer->                                                                                                                                                                             run()
#10 /usr/share/php/Composer/Command/RequireCommand.php(285): Composer\Command\Re                                                                                                                                                                             quireCommand->doUpdate()
#11 /usr/share/php/Symfony/Component/Console/Command/Command.php(298): Composer\                                                                                                                                                                             Command\RequireCommand->execute()
#12 /usr/share/php/Symfony/Component/Console/Application.php(1015): Symfony\Comp                                                                                                                                                                             onent\Console\Command\Command->run()
#13 /usr/share/php/Symfony/Component/Console/Application.php(299): Symfony\Compo                                                                                                                                                                             nent\Console\Application->doRunCommand()
#14 /usr/share/php/Composer/Console/Application.php(336): Symfony\Component\Cons                                                                                                                                                                             ole\Application->doRun()
#15 /usr/share/php/Symfony/Component/Console/Application.php(171): Composer\Cons                                                                                                                                                                             ole\Application->doRun()
#16 /usr/share/php/Composer/Console/Application.php(131): Symfony\Component\Cons                                                                                                                                                                             ole\Application->run()
#17 /usr/bin/composer(84): Composer\Console\Application->run()
#18 {main}
  thrown in /usr/share/php/Symfony/Component/Console/Helper/Helper.php on line 6     

I tried to install php-intl as was suggested on other posts, but it says it's already installed. Thanks in advance for any help.

I've scoured the internet for a solution but none of the suggestions have worked so far. Using php 8.1.

Designly
  • 266
  • 1
  • 9

1 Answers1

3

I figured it out. I used the default composer package provided by ubuntu jammy. I removed that package and downloaded and manually installed the latest version of composer:

sudo apt remove composer
sudo apt install php-cli unzip
cd ~
curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
HASH=`curl -sS https://composer.github.io/installer.sig`

php -r "if (hash_file('SHA384', '/tmp/composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer
Designly
  • 266
  • 1
  • 9
  • 1
    Another way to install Composer: `curl -sS https://getcomposer.org/installer | php && sudo mv composer.phar /usr/local/bin/composer` – arieltools Jun 11 '23 at 05:14