1

Hello I am trying to use laravel but i fail with the installation of composer.

I am using a windows 7 and when I install the setup of composer there is not any problem. The problem come when I use the comand composer -V it return to me these error.

I do not undestand what it means. if someone can explain to me the error. Thanks for read it. And sorry if there are some post like these but where i could read i do not undesrtand nothing.

mohamet monte
  • 53
  • 1
  • 10

4 Answers4

1

paste composer.json file on a validator and it should point out the syntax error

try http://www.jsonlint.com

Sherif
  • 1,477
  • 1
  • 14
  • 21
0

It returns the error:

Parse error on line 1:
MZ
^
Expecting one of: 'String', 'Number', 'Null' ... {', '['

Kindly check your entire JSON must start from '{' and end from '}' so your invalid JSON convert into Valid JSON.

Copy your JSON into this website: http://jsonlint.com/

Noman
  • 1,459
  • 2
  • 18
  • 38
0

First make sure that you can use php on your command line. You can run:

php -v 

This should give you the php version. If not, add the php executable to your windows path file (https://stackoverflow.com/a/7307581/1354222).

Run this in your bash window, in the laravel folder, to get the latest composer version (installation instructions are from the composer website):

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === 'aa96f26c2b67226a324c27919f1eb05f21c248b987e6195cad9690d5c1ff713d53020a02ac8c217dbf90a7eacc9d141d') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

Then use the following command to install laravel (from the laravel website, slightly adapted for your situation):

php composer.phar create-project --prefer-dist laravel/laravel blog
Community
  • 1
  • 1
11mb
  • 1,339
  • 2
  • 16
  • 33
0

try update you vendor/composer/installer.json to following.

{}

this same happened to me

RED
  • 57
  • 8