5

I have tried to install Tailwind CSS. I have run the following command.

npm install -D tailwindcss
npx tailwindcss init

However, I have an error.

Unexpected token {

Maybe someone had the same mistake. I have an empty Laravel instance and I want to add tools for the UI.

1
  • 1
    Which version of nodejs are you using? Try upgrading to 14 if it's not the case and try again. The problem could be with postCSS. Getting the latest nodejs version will most probably solve your issue. Commented Jan 4, 2021 at 5:45

3 Answers 3

1

First, make sure you have the latest package versions.

npm install -D laravel-mix@latest tailwindcss@latest postcss@latest autoprefixer@latest
Sign up to request clarification or add additional context in comments.

Comments

1

Here is the issue

Actually the problem is with node/npm version. Try to upgrade the node version which is compitale with tailwindcss.

Comments

0

I was able to fix the error by upgrading NodeJS to the latest stable version.

sudo npm install -g n

sudo n stable

then

npx tailwindcss -i ./path/style.css -o ./path/output.css --watch

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.