Npx tailwindcss results in "Unexpected Token ." This error is unhelpful. #8807
Replies: 17 comments 18 replies
-
Hey! Gonna need a lot more information here sorry. Can you provide exact steps to reproduce as well as provide the complete error? Just a few examples of things I don't know from this:
So please provide every detail, we have issue templates for a reason 🙂 |
Beta Was this translation helpful? Give feedback.
-
Hello,
Running I tried to update or reinstall nodejs and tailwindcss but I still have the same issue |
Beta Was this translation helpful? Give feedback.
-
Hello, Node v14.15.0 |
Beta Was this translation helpful? Give feedback.
-
Same issue here. Following either the TailwindCSS CLI or PostCSS instructions on the website. I've reverted back to 3.1.4 and everything is working as expected. Running npx tailwindcss init /home/mojo/TOP/weather-app/node_modules/yaml/dist/compose/composer.js:33 SyntaxError: Unexpected token '.' |
Beta Was this translation helpful? Give feedback.
-
I had the exact same error message running node 16.18.0, on Windows 11. PS C:\Users\Kacpe\Documents\GitHub\SWE\SWE-MehrMarkt\Frontend> nvm use 16.13.2
Now using node v16.13.2 (64-bit)
PS C:\Users\Kacpe\Documents\GitHub\SWE\SWE-MehrMarkt\Frontend> npx tailwindcss init -p
Created Tailwind CSS config file: tailwind.config.js
Created PostCSS config file: postcss.config.js |
Beta Was this translation helpful? Give feedback.
-
I had this issue too. and i will work magicly! |
Beta Was this translation helpful? Give feedback.
-
Good pm tanjil. To debug this code all you need to do is to install the
latest node version.
…On Mon, Jun 26, 2023, 1:13 PM Tanjil ***@***.***> wrote:
i tried with that
i got the same error
npx ***@***.*** init -p
/home/tsk/Desktop/eco-escola/node_modules/yaml/dist/compose/composer.js:33
if (prelude[i + 1]?.[0] !== '#')
^
SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/tsk/Desktop/eco-escola/node_modules/yaml/dist/index.js:3:16)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
—
Reply to this email directly, view it on GitHub
<#8807 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASSLRLAGZ2OKFSYQP43IAKDXNF4HFANCNFSM53BAHWQA>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
Hello, I got the same error on my Ubuntu 22.04 when running npx tailwondcss init. I appreciate any help |
Beta Was this translation helpful? Give feedback.
-
Delete the node_modules directory and the package-lock.json file (or yarn.lock if you're using Yarn) from your project's root directory. Then, reinstall the dependencies by running npm install or yarn install. See if the version of both node and tailwind are supported. |
Beta Was this translation helpful? Give feedback.
-
When attempting to initialize Tailwindcss, I encountered an issue.
I'm currently using a specific project version. I would like to know if this version supports the latest Tailwindcss or not.
|
Beta Was this translation helpful? Give feedback.
-
Hey! |
Beta Was this translation helpful? Give feedback.
-
El problema que todos tienen es que no instalaron node como señaló Gelloiss, acá hay una indicación de cómo hacerlo en freeCode: Una vez instalado node deben actualizarlo con nvm install 14 (14 o la versión que quieran) The problem everyone has is that they didn't install node as Gelloiss pointed out, here is an indication of how to do it in freeCode: Once node is installed, you must update it with nvm install 14 (14 or the version you want) https://www.freecodecamp.org/news/node-version-manager-nvm-install-guide/) |
Beta Was this translation helpful? Give feedback.
-
Solved this by installing the latest version of node. Here's how to upgrade node version as mentioned here. It worked on my Ubuntu 22.04 To check your Ubuntu version:
Download the latest tar.xz NodeJS file from https://nodejs.org/en/download/
Where #.#.# is the version you downloaded. Verify installation using
|
Beta Was this translation helpful? Give feedback.
-
Hello, I was able to fix the error by upgrading NodeJS to the latest stable version.
then |
Beta Was this translation helpful? Give feedback.
-
Hello |
Beta Was this translation helpful? Give feedback.
-
For those who are googling this question, it might be helpful to make sure your In my case, my issue was not wrapping my |
Beta Was this translation helpful? Give feedback.
-
Error: In my case, I found the solution. It was for the following issue:
See the image below. I simply Solution: Version
|
Beta Was this translation helpful? Give feedback.
-
As described in title.
This is on up to date npm and tailwind build.
Its kind of hard to diagnose.
Beta Was this translation helpful? Give feedback.
All reactions