Décrivez ici votre problème ou ce que vous cherchez à faire.

J'ai deja installer composer vias le terminal de mac.
je veux maintenent installer altoRouter vias le terminal de vs code et j'ai cette reponse:bash: composer: command not found 

Aide-moi s'il vous plait:(

12 réponses


Curvata
Réponse acceptée

Tu dois mettre ton composer dans le dossier /usr/local/bin/ pour l'avoir globalement, si tu n'as pas changé le nom à l'installation ton composer s'appelle avec la commande composer.phar donc tu fais php composer.phar require blabla

Evites d'écrire plusieurs fois le même sujet. Merci.

Bonjour,

il faut installer composer en globale si tu veux atteindre la commande partout.

merciful
Auteur

oui c'est ce que j'ai fait

Si c'était le cas, tu aurais le logo Composer ainsi que toutes les commandes en tapant composer dans ton terminal.

merciful
Auteur

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
voici les commandes de l'installation

Tu dois déplacer composer mv composer.phar /usr/local/bin/composer

merciful
Auteur

ok merci je vais l'essayer et je te reviens

merciful
Auteur

J'ai l'ai fait et cela n'a pas marcher
J'ai ce rsultat: mv: rename composer.phar to /usr/local/bin/composer: Permission denied

sudo mv composer.phar to /usr/local/bin

Sinon à l'installation tu fais

php composer-setup.php --install-dir=/usr/local/bin --filename=composer
merciful
Auteur

voici le resultat: mv: rename to to /usr/local/bin/to: No such file or directory

merciful
Auteur

j'ai bien installer composer mais je n'arrive pas a utiliser la comande "composer" pour installer les dependences
** __
/ __/_ __ _ ____
/ / /
\/ ` \/ \/ \/
/ _ \/ /
/ /
/ // / / / / / / // / // ( ) / /
__/__/
/ // // ./__/__/\//
/
/
Composer version 2.0.12 2021-04-01 10:14:59

Usage:
command [options] [arguments]

Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--profile Display timing and memory usage information
--no-plugins Whether to disable plugins.
-d, --working-dir=WORKING-DIR If specified, use the given directory as working directory.
--no-cache Prevent use of the cache
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
about Shows the short information about Composer.
archive Creates an archive of this composer package.
browse Opens the package's repository URL or homepage in your browser.
cc Clears composer's internal package cache.
check-platform-reqs Check that platform requirements are satisfied.
clear-cache Clears composer's internal package cache.
clearcache Clears composer's internal package cache.
config Sets config options.
create-project Creates new project from a package into given directory.
depends Shows which packages cause the given package to be installed.
diagnose Diagnoses the system to identify common errors.
dump-autoload Dumps the autoloader.
dumpautoload Dumps the autoloader.
exec Executes a vendored binary/script.
fund Discover how to help fund the maintenance of your dependencies.
global Allows running commands in the global composer dir ($COMPOSER_HOME).
help Displays help for a command
home Opens the package's repository URL or homepage in your browser.
i Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
info Shows information about packages.
init Creates a basic composer.json file in current directory.
install Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
licenses Shows information about licenses of dependencies.
list Lists commands
outdated Shows a list of installed packages that have updates available, including their latest version.
prohibits Shows which packages prevent the given package from being installed.
remove Removes a package from the require or require-dev.
require Adds required packages to your composer.json and installs them.
run Runs the scripts defined in composer.json.
run-script Runs the scripts defined in composer.json.
search Searches for packages.
self-update Updates composer.phar to the latest version.
selfupdate Updates composer.phar to the latest version.
show Shows information about packages.
status Shows a list of locally modified packages.
suggests Shows package suggestions.
u Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
update Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
upgrade Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
validate Validates a composer.json and composer.lock.
why Shows which packages cause the given package to be installed.
why-not Shows which packages prevent the given package from being installed.
MacBook-Pro-de-myname:tab apetchomawuto$ php -r "unlink('composer-setup.php');"
MacBook-Pro-de-myname:tab apetchomawuto$ php composer
Could not open input file: composer
MacBook-Pro-de-myname:tab apetchomawuto$ php composer
Could not open input file: composer
MacBook-Pro-de-myname:tab apetchomawuto$ php composerphp -r "unlink('composer-setup.php');"
Could not open input file: composerphp
MacBook-Pro-de-myname:tab apetchomawuto$ composer
bash: composer: command not found
MacBook-Pro-de-myname:tab myname$ php composer.phar

/ __/_ __ _ ____
/ / /
\/ ` \/ \/ \/
/ _ \/ /
/ /
/ // / / / / / / // / // ( ) / /
__/__/
/ // // ./__/__/\//
/
/
Composer version 2.0.12 2021-04-01 10:14:59

Usage:
command [options] [arguments]

Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--profile Display timing and memory usage information
--no-plugins Whether to disable plugins.
-d, --working-dir=WORKING-DIR If specified, use the given directory as working directory.
--no-cache Prevent use of the cache
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
about Shows the short information about Composer.
archive Creates an archive of this composer package.
browse Opens the package's repository URL or homepage in your browser.
cc Clears composer's internal package cache.
check-platform-reqs Check that platform requirements are satisfied.
clear-cache Clears composer's internal package cache.
clearcache Clears composer's internal package cache.
config Sets config options.
create-project Creates new project from a package into given directory.
depends Shows which packages cause the given package to be installed.
diagnose Diagnoses the system to identify common errors.
dump-autoload Dumps the autoloader.
dumpautoload Dumps the autoloader.
exec Executes a vendored binary/script.
fund Discover how to help fund the maintenance of your dependencies.
global Allows running commands in the global composer dir ($COMPOSER_HOME).
help Displays help for a command
home Opens the package's repository URL or homepage in your browser.
i Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
info Shows information about packages.
init Creates a basic composer.json file in current directory.
install Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
licenses Shows information about licenses of dependencies.
list Lists commands
outdated Shows a list of installed packages that have updates available, including their latest version.
prohibits Shows which packages prevent the given package from being installed.
remove Removes a package from the require or require-dev.
require Adds required packages to your composer.json and installs them.
run Runs the scripts defined in composer.json.
run-script Runs the scripts defined in composer.json.
search Searches for packages.
self-update Updates composer.phar to the latest version.
selfupdate Updates composer.phar to the latest version.
show Shows information about packages.
status Shows a list of locally modified packages.
suggests Shows package suggestions.
u Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
update Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
upgrade Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
validate Validates a composer.json and composer.lock.
why Shows which packages cause the given package to be installed.
why-not Shows which packages prevent the given package from being installed.
**

merciful
Auteur

Merci Curvata