所以我目前正在使用 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/