解决用户认证脚手架命令 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 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!
未填写
文章
67
粉丝
17
喜欢
141
收藏
119
排名:130
访问:7.5 万
私信
所有博文
社区赞助商