[RuntimeException] Unable to detect application namespace

Hi to all!

When I use cmd command

php artisan make:command FooCommand

i get runtime error from thread subject. May be someone decide this problem?

Thanks in advance.

esomkin replied 2 years ago Solution

Problem solved. It's my oversight )

Logik22 replied 2 years ago

Why not post your solution so when people google it and open the first result they don't just see "problem solved"?!?

Logik22 replied 2 years ago

For me the solution was to fix the composer.json file in the project. Under require-dev I had

	"require-dev": {
		"phpunit/phpunit": "~4.0",
		"phpspec/phpspec": "~2.1",

At one point I had 3 in there and when I removed it I forgot to remove the 2nd comma. Once I fixed this code make:request executed appropriately.

	"require-dev": {
		"phpunit/phpunit": "~4.0",
		"phpspec/phpspec": "~2.1"
shuyye replied 2 years ago

@brent2890 thanks for this, I had a comment in the composer.json file and it totally blocked the make requests. Nice spot. :)

imanghafoori1 replied 2 years ago

Same problem Same solution for me, it was caused by and extra , camma in my composer.json file

stefanschindler replied 2 years ago

Thanks, Brent2890, same solution worked for me. I had an additional character in the composer.json file

unclepickles replied 2 years ago

to be honest I had the same problem and it was solved by removing a comma from the require-dev section

justk replied 1 year ago

Yes I had the same issue and then solved by removing the comma in the composer.json file, thanks OP!

tournasdim replied 1 year ago

The CLI command : "composer diagnose" (without the double quotes) is very handy for checking syntax errors in the composer.json file .

IdrisFab replied 1 year ago

Worked for me, some missing brackets, so its safe to say, This namespace error indicates that there is an error with the composer.json file.


manusoriano84 replied 6 months ago

Thanks! Worked for me. Apparently you have to eliminate the extra commas. Regardless of where it is, in my case it was in "require" instead of "require-dev"

legobrainiac replied 3 months ago

Same problem, and this worked! Thanks!

Sign in to participate in this thread!

We'd like to thank these amazing companies for supporting us