Looks like it tries to get the namespace here https://github.com/laravel/framework/blob/8.x/src/Illuminate/Foundation/Application.php#L1399
Mar 8, 2023
2
Level 1
artisan commands not running without composer.json
We recently deployed to production environment and found out that the artisan commands are not running.
running php artisan commands return below error:
In Application.php line 1399:
file_get_contents(/var/www/html/composer.json): Failed to open stream: No such file or directory
Adding composer.json fixes the issue.
We never deploy composer.json to our production environments but artisan always worked.
We build our deployment package by running composer install and npm run prod. Below files are deleted subsequently as they are no longer needed.
- composer.json
- composer.lock
- package-lock.json
- package.json
Please or to participate in this conversation.