Warm tip: This article is reproduced from stackoverflow.com, please click
laravel laravel-6

Laravel 6.0.3 Not Loading Key Resources App.js or App.css 404 Not Found

发布于 2020-04-15 10:37:17

To setup my project I ran:

laravel new cms
composer require laravel/ui
php artisan ui:auth
php artisan migrate

However, when I go to http://cms.test/login I am shown the login page:

enter image description here

And get two 404 errors for missing resources:

http://cms.test/js/app.js net::ERR_ABORTED 404 (Not Found)
http://cms.test/css/app.css

What could be the reason for these missing files?

My public directory is empty aside from .htaccess, favicon.ico, index.php and robot.txt files, is that normal?

Questioner
Jack Robson
Viewed
34
Jack Robson 2019-09-15 11:07

My setup was a little wrong, I mostly forgetting to run npm install and npm run dev command that is required to compile the app.js and app.css files.

Correct setup command sequence was:

laravel new cms
cd cms
php artisan migrate
composer require laravel/ui
npm install
php artisan ui vue --auth
npm install && npm run dev