Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Oxyrus's avatar

Error running laravel new "Composer could not find a composer.json"

Hello, I installed composer and laravel apparently, but whenever I run laravel new myprojectname I got the error

Crafting application...
Composer could not find a composer.json file in /home/andres/Dev/PHP/Laravel/quickstart
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section

And if I try to run

composer create-project laravel/laravel quickstart --prefer-dist

I get

Failed to decode response: zlib_decode(): data error
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info

And it doesn't download laravel.

Could you guys assist me please?

Thanks!

0 likes
4 replies
jlrdw's avatar

In a previous post you had laravel already installed, I don't understand.

Pascal's avatar

Same problem here, "laravel new projectName" doesn't seem to work properly. "Composer could not find a composer.json file#

jlrdw's avatar

Have you done a composer self update, and cleared composes cache?

Please or to participate in this conversation.