NPM在Laravel 9中运行DEV
在此处输入图像描述当我在Laravel创建一个新项目时,我有问题构建验证...这是我的cmd命令:
laravel new laravel2030
cd laravel2030
composer require laravel/ui
php artisan ui bootstrap --auth
npm install
npm run dev
enter image description hereI have a problem when I create a new project in laravel and I want to build authintication ...this is my cmd command :
laravel new laravel2030
cd laravel2030
composer require laravel/ui
php artisan ui bootstrap --auth
npm install
npm run dev
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在Laravel 9更新中,我们使用Vite而不是混合
然后,您需要下面的运行命令,而不是npm运行dev才能构建app.js,app.css:
运行vite命令以构建资产文件
在以下内容中查看有关此信息的更多信息: https://techvblogs.com/blog/blog/blog/how-to-to-install- Bootstrap-5-in-laravel-9-with-with-vite
in laravel 9 update we use Vite instead of mix
then you need run command below instead npm run dev to build app.js, app.css:
Running Vite Command to build Asset File
see more about this in:https://techvblogs.com/blog/how-to-install-bootstrap-5-in-laravel-9-with-vite
在Laravel 9中,该命令也有效。
https://vitejs.s.s.s.s.s.s.dev/guide/guide/guide/build.html#rebuild-rebuild-rebuild-rebuild-rebuild-rebuild-rebuild-rebuild-rebuild-rebuild-rebuild-redbuild-餐厅变更
In Laravel 9 this command works too.
https://vitejs.dev/guide/build.html#rebuild-on-files-changes
现在,Laravel开始实现Vite而不是Mixin
,因此您需要还原回混合,我不建议您
通过插入Laravel Mix
package.json中的脚本部分。
,然后更新 与vite兼容,我认为这是时间问题,直到Laravel UI软件包进行更新以默认实现此目标
您可以从步骤5开始(如果您已经有了一个项目)开始此教程,或者从第一步开始创建新项目,并查看如何修复此
https://techvblogs.com/blog/how-to-to-now-to-now-to-install-bootstall-bootstall-bootstall-bootstall-5-in-laravel-9 -with-vite
您只需要在4个文件中进行编辑即可解决此问题
now laravel started to implement Vite instead of mixin
so you need to revert back to mix which I don't recommend
by intsalling laravel mix
then update the scripts section in package.json to be like this
OR second option update your laravel ui view files to be compatible with vite which I think is a matter of time till laravel ui package make an update to implement this by default
You can follow this tutorial starting from step 5(if you already have a project) or follow from first step to create new project and see how you can fix this
https://techvblogs.com/blog/how-to-install-bootstrap-5-in-laravel-9-with-vite
you'll just need to edit in 4 files I think to fix this
在package.json文件中进行问题
认为您必须
我
。
I think the problem in package.json file
You have to change "dev": "vite" in package.json
to be "dev":"mix" like this
and run npm run dev again.