Reputation: 1618
I've installed the composer on my ubuntu server by instruction in download page to command-line installation.
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
and for install globally followed getting started instruction:
mv composer.phar /usr/local/bin/composer
after running commands I get: All settings correct for using Composer Downloading...
Composer (version 1.10.4) successfully installed to: /root/composer.phar
Use it: php composer.phar
but now when I enter composer command facing with this error:
[Seld\JsonLint\ParsingException]
"/root/.composer/auth.json" does not contain valid JSON
Parse error on line 1:
^
Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
I tried curl -sS https://getcomposer.org/installer | php -- --check
and get this:
All settings correct for using Composer
and when using composer diagnose
getting the same error. tried to purge and reinstall but nothing changed:
sudo apt-get purge --auto-remove composer
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'composer' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
/root/.composer/auth.json
file is empty
Upvotes: 1
Views: 483
Reputation: 12105
The error message tells you pretty much about the problem: the content of /root/.composer/auth.json
is not valid JSON. If that file is empty, there is no need to keep it there - so either place your authentication details in that file or remove that file until you need it
Upvotes: 1