I face the same problem while implementing the composer require laravel/ui
in laravel version 7 but I fixed it by following the below steps.
First :
- Download nodejs
- Install nodejs in your pc
Second : run this command
composer require laravel/ui
Once the laravel/ui
package has been installed, you may install the frontend scaffolding using the ui Artisan command:
// Generate basic scaffolding...
php artisan ui bootstrap
php artisan ui vue
php artisan ui react
// Generate login / registration scaffolding...
php artisan ui bootstrap --auth
php artisan ui vue --auth
php artisan ui react --auth
To generate node_module
folder inside your project run the below command
npm install
Once the dependencies have been installed using npm install, you can compile your SASS files to plain CSS using Laravel Mix. The npm run dev command will process the instructions in your webpack.mix.js file. Typically, your compiled CSS will be placed in the public/css directory:
npm run dev
some time you may need to run this command npm audit fix
or npm audit fix --force
to fix some packages if they required to be.
Maybe some time by running this command npm run dev
or npm run watch
it will show you an error like below.
@ dev C:\xampp\htdocs\Auth
npm run development
@ development C:\xampp\htdocs\Auth
mix
Additional dependencies must be installed. This will only take a moment.
Finished. Please run Mix again.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `mix`
jus run the npm run watch
again it will start Mix █████████████████████████ emitting (95%)
after the success the build will be succeeded too.