解決使用者認證腳手架命令 no commands defined in the "ui" namespace 的問題

zhaiduting發表於2020-09-17
>php artisan ui:auth
  There are no commands defined in the "ui" namespace.  

使用7.28的版本新建了一個專案,但是執行認證腳手架命令的時候報錯。需要安裝 laravel/ui

>composer require laravel/ui
Using version ^3.0 for laravel/ui
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: remove laravel/framework v7.28.2
    - Conclusion: don't install laravel/framework v7.28.2

還是報錯,這個是版本錯誤,改用一個低版本就OK了

>composer require laravel/ui:2.*
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing laravel/ui (v2.4.0): Downloading (100%)

安裝成功,之後執行命令OK

>php artisan ui vue --auth
Vue scaffolding installed successfully.
Please run "npm install && npm run dev" to compile your fresh scaffolding.
Authentication scaffolding generated successfully.

總之,兩條命令
composer require laravel/ui:2.*
php artisan ui vue --auth

本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章