I'm new to Symfony and I'm following a couple of quick introductions on the Symfony website: the quick tour and installation guide. Both say you can install a server using:
composer require server --dev
When I run this command I get:
[InvalidArgumentException]
Could not find package server.
Did you mean one of these?
react/http
react/socket
cboden/ratchet
voryx/thruway
laravel/passport
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...
Okay, I can ignore this and use another local server, but I wondered if I was doing something wrong or if the documentation is out of date? Composer is installed fine on my machine (a Mac).
So the answer is: I wasn't in the 'quick_tour' directory that is created in the quick tour tutorial. It doesn't actually say to cd into that, but I suppose I should have guessed! After you cd into that the command works fine.
I had the same problem. You need to cd
in the project directory before running the composer again. This resolved the error for me.
To fix the mistake, you must change your directory in the new file of your project and after it's running, you must give the correct route of the new file of the project created by composer.
composer create-project symfony/skeleton my-project
You must change directory with cd my-project to not stay in the previous directory when you had installed and created the file my-project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With