Laravel Tailwind 身份验证脚手架问题

标签 laravel authentication npm webpack tailwind-css

所以我目前正在使用 Laravel 和 Tailwind。我已经创建了一个项目并通过一些初步 View 进行工作。接下来要做的就是向项目添加身份验证脚手架。

我尝试谷歌搜索,发现https://aregsar.com/blog/2020/create-laravel-project-with-tailwind-ui-and-auth/ 。我还检查了其他几个具有相同指针的结果。

因此,当我运行 composer require laravel-frontend-presets/tailwindcss --dev 时,没有问题。接下来我运行以下命令。

php artisan ui tailwindcss --auth
Tailwind CSS scaffolding installed successfully.
Tailwind CSS auth scaffolding installed successfully.
Please run "npm install && npm run dev" to compile your fresh scaffolding.

没有问题...但是,当我尝试运行 npm install 时,我得到以下信息...

npm install && npm run dev

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: undefined@undefined npm ERR! Found: [email protected] npm ERR! node_modules/tailwindcss npm ERR!
dev tailwindcss@"^2.2.6" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer tailwindcss@"^1.3.3" from @tailwindcss/[email protected] npm ERR! node_modules/@tailwindcss/ui npm ERR!
dev @tailwindcss/ui@"^0.3" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See /home/tam/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in: npm ERR!
/home/xxx/.npm/_logs/2021-07-26T19_33_44_249Z-debug.log

卡在这里。遗憾的是,与 Bootstrap 相比,我更喜欢 Tailwind。

最佳答案

@tailwindcss/ui 是 no longer needed 。卸载@tailwindcss/ui 包。

npm uninstall @tailwindcss/ui

安装 Laravel Mix、Autoprefixer 和 PostCSS 的最新依赖项。

npm install -D laravel-mix@latest postcss@latest 
    autoprefixer@latest tailwindcss@latest

最后,确保该行...

require('@tailwindcss/ui'),

从 tailwind.config.js 文件中删除。

继续编译。

npm install && npm run dev

关于Laravel Tailwind 身份验证脚手架问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68535801/

相关文章:

php - 插入表情符号时插入语句有效,但使用 Eloquent 时会抛出错误

php - Laravel 5 中 RouteCollection.php 中的 MethodNotAllowedHttpException

java - 使用我的 Facebook 应用程序中的 session key 将用户登录到 Facebook

java - 使用hibernate动态登录数据库

javascript - 如何要求全局使用 npm 安装模块?

npm - json-server 我们可以使用其他键而不是 id 来发送和放置请求吗

php - 无法使用 Auth::user() 仅使用\Auth::user() 获取 user_id Laravel

php - 我需要在 Laravel 的 MySql 查询中匹配一个字符串

azure - MSAL token 将在 1 小时后过期

javascript - 引用错误 : process is not defined when requiring Shelljs in ReactJS