Installation into Laravel 8 following documentation fails at `npx tailwindcss` stage
See original GitHub issueDescribe the problem:
Installing using the Laravel-specific installation guide fails when creating tailwind.config.js file with error Cannot find module 'autoprefixer'
.
Minimal reproduction:
> laravel new twtest
> cd twtest
> npm install
> npm install -D tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9
> npx tailwindcss init
npx: installed 84 in 5.511s
Cannot find module 'autoprefixer'
Require stack:
- /Users/adam/.npm/_npx/16279/lib/node_modules/tailwindcss/lib/cli/commands/build.js
- /Users/adam/.npm/_npx/16279/lib/node_modules/tailwindcss/lib/cli/commands/index.js
- /Users/adam/.npm/_npx/16279/lib/node_modules/tailwindcss/lib/cli/main.js
- /Users/adam/.npm/_npx/16279/lib/node_modules/tailwindcss/lib/cli.js
Versions:
> npm -v
6.14.8
> php artisan -V
Laravel Framework 8.16.1
> cat package.json
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"autoprefixer": "^9.8.6",
"axios": "^0.19",
"cross-env": "^7.0",
"laravel-mix": "^5.0.1",
"lodash": "^4.17.19",
"postcss": "^7.0.35",
"resolve-url-loader": "^3.1.0",
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.1"
}
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Laravel 8 Installing Tailwind CSS ModuleBuildError
when trying to install tailwind CSS using the npm command. npm install tailwindcss@npm:@tailwindcss/postcss7-compat @tailwindcss/postcss7-compat ...
Read more >Installation - Tailwind CSS
The simplest and fastest way to get up and running with Tailwind CSS from scratch is with the Tailwind CLI tool.
Read more >Laravel 8 Jetstream - Tailwind CSS not working - Laracasts
When I tried to use Tailwind CSS in welcome blade view, I'm not getting anything formatted like it should be under Tailwind CSS....
Read more >How to install and build TailwindCSS v2 with Laravel Mix
Most tools haven't yet updated, as explained in their documentation. "Tailwind CSS depends on PostCSS 8. Because PostCSS 8 is only a few...
Read more >Setting Up TailwindCSS on Laravel | Scout APM Blog
Now after Laravel installation is complete, run the following command to create your ... The next step is installing Tailwind CSS via npm....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If you don’t want to upgrade NodeJS/NPM, you may try running
npx tailwindcss-cli@latest init -p
.@rmahmood19 that also worked for me, thank you.
This does feel a bit wrong, though - the latest version of node is v14.15.1 (according to
n stable
).Instructions for upgrading node
npm install -g n
n latest