Hi Rick,
The error message:
Invalid "america/new" locale.
means that somewhere in your configuration, the locale is being set to america/new, which is not a valid locale string. Locale values should use underscores or hyphens (like en_US or en), not slashes.
Let's break down your .env and config/app.php:
Your .env:
APP_TIMEZONE=America/New_York
APP_URL=http://localhost
APP_LOCALE=america/new_york
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
Your config/app.php:
'timezone' => env('APP_TIMEZONE', 'America/New_York'),
'locale' => env('APP_LOCALE', 'en'),
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),
The Issue
APP_TIMEZONEis correct:America/New_York(for timezones, slashes are valid).APP_LOCALEis set toamerica/new_york, which is not a valid locale. Locales should look likeen,en_US,fr, etc.
The error message refers to america/new, which suggests that somewhere, the value is being truncated or misread (possibly due to a typo or an environment variable parsing issue).
Solution
1. Change your .env to use a valid locale:
Replace:
APP_LOCALE=america/new_york
with:
APP_LOCALE=en
or, if you want US English:
APP_LOCALE=en_US
2. Clear your config cache:
After updating your .env, run:
php artisan config:clear
php artisan cache:clear
3. Try running composer again:
composer dump-autoload
composer install
Why did this work on your old machine?
- Your old machine may have had a cached or default value for
APP_LOCALE. - The new machine is reading the
.envas-is, and the invalid value is causing the error.
Summary
- Locales (APP_LOCALE) should be like
en,en_US,fr, etc. - Timezones (APP_TIMEZONE) can be like
America/New_York.
Final .env example:
APP_TIMEZONE=America/New_York
APP_URL=http://localhost
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
Let me know if this solves your issue!
