解决用户认证脚手架命令 no commands defined in the "ui" namespace 的问题

>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 协议》,转载必须注明作者和本文链接
《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
未填写
文章
68
粉丝
17
喜欢
141
收藏
119
排名:130
访问:7.5 万
私信
所有博文
社区赞助商