Issues installing Tailwindcss, specifically with "npx tailwindcss init" - tailwind-css

Im following the documentation but im stuck right at the npx tailwindcss init
https://tailwindcss.com/docs/installation

Check if your directory is initialized as a node project, i.e. it contains package.json file. If not then do this:
$/> npm init -y
Install tailwindcss as a dev dependency (optional as a dev dependency)
$/> npm i -D tailwindcss

Step : 1
Correct you directory path like this C:\Users\user\Documents\Web Dev\Tailwindcss_AlpineJs\pratice tailwind then try this command npx tailwindcss init
Step : 2
Not working above step : 1 then try this command : npx tailwindcss-cli#latest init -p.

Related

how to create a nextjs project with older version?

nextjs 13 has been released but when I create a new project I only want to use nextjs version 12, how can I do that?
All the install commands on the nextjs doc are creating a project folder with nextjs 13.
https://nextjs.org/docs
you can run this
npx create-next-app && cd myApp && npm i -S next#12
or this
npx create-next-app and then change next version to 12 from package.json manually

Object.fromEntries is not a function

I've been following Tailwind's tutorials and when. I get to the part of the tutorial where they ask me to run
-npx tailwindcss init,
-Object.fromEntries is not a function
I get the following error. How do I solve this?
I'm trying to learn tailwind css and I got a problem that I don't understand, please help me guys
first run node -v in your terminal to check you have nodejs or not
then run npm init -y to install dependencies'
then run npm install -D tailwindcss
after that run npx tailwindcss init
hopefully after doing this you will be able to process further into your project

Dependencies with tailwind that are installed in Create react app

why dont we now install lib such as postcss and autoprfixers with tailwind css on CRA
Now If I go to Tailwind docs for installtion of tailwind into my react app which has been
created with CRA
https://tailwindcss.com/docs/guides/create-react-app
npm install -D tailwindcss
npx tailwindcss init
but if my memory serves right it used to be
npm install -D tailwindcss autoprefixer postcss
npx tailwindcss init
You are correct. According to this commit Tailwind has changed the installation guide.
They did this to discourage using CRA more since there are better tools out there to create a React app. For example Vite
From the Install Tailwind CSS with Create React App
Create React App does not support custom PostCSS configurations
When using Vite the Tailwind docs do say to install postcss and autoprefixer
npm create vite#latest my-project -- --template react
cd my-project
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p

I added tailwindcss 3 to the vue-sfc-rollup project but it doesn't work

I added tailwindcss 3 to the vue-sfc-rollup project but it doesn't work
ERROR Failed to compile with 1 error
error in ./dev/index.css
Syntax Error: Error: PostCSS plugin tailwindcss requires PostCSS 8.
Migration guide for end-users:
https://github.com/postcss/postcss/wiki/PostCSS-8-for-end-users
Try:
npm uninstall tailwindcss postcss autoprefixer
npm install -D tailwindcss#npm:#tailwindcss/postcss7-compat postcss#^7 autoprefixer#^9
Once the rest of your tools have added support for PostCSS 8, you can
move off of the compatibility build by re-installing Tailwind and its
peer-dependencies using the latest tag:
npm uninstall tailwindcss
npm install -D tailwindcss#latest postcss#latest autoprefixer#latest
For more information see here

Dotnet new - webpack.js missing

I downloaded .NET Core SDK version 2.1 and I ran :
dotnet new angular -n testAngular
... and the project was created successfully.
Then I ran:
cd testAngular
dotnet run
Which resulted in the following error :
EXEC : error : Cannot find module
C:\Users\OLE\source\repos\testAngular\node_modules\webpack\bin\webpack.js
How can I avoid this error? Adding an empty webpack.js didn't work. Why was webpack.js not added, when running dotnet new ? What should I put in it?
Thanks.
Your node_modules library doesn't have webpack installed.
Could be two reasons
Your package.json includes webpack, and you never installed it.
Inside testAngular run
npm install
Your project doesn't include webpack.
Inside testAngular run
npm install webpack -D
If you can't run npm, then install it from nodejs

Resources