tailwindcss icon indicating copy to clipboard operation
tailwindcss copied to clipboard

1.0 NPM Install - Unexpected Token ...

Open keisto opened this issue 7 years ago • 7 comments

Using a brand new laravel 5.8 app.

npm install

npm install tailwindcss --save-dev

npx tailwind init

Unexpected token ...

npx tailwind build styles.css -o output.css

Unexpected token ...

I would like to use the latest version of tailwind, but this isn't working. I can use the older version just fine.

keisto avatar May 14 '19 23:05 keisto

Looks like node incompatibility, what's your version? Tailwind 1.0 needs >= 8.9.0

tlgreg avatar May 15 '19 05:05 tlgreg

Yeah make sure you are on a supported version of Node and you should be good to go 👍🏻

adamwathan avatar May 15 '19 11:05 adamwathan

npx tailwindcss init result showing unexpected token {

imsagorahmed avatar Jan 14 '21 15:01 imsagorahmed

bado@DESKTOP-NHE2DH6:~/api2$ npx tailwindcss init
/home/bado/api2/node_modules/color/index.js:257
                        lum[i] = (chan <= 0.039_28) ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
                                          ^^^^^

SyntaxError: Invalid or unexpected token
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/bado/api2/node_modules/tailwindcss/lib/util/pluginUtils.js:25:37)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    ```

Eboubaker avatar Sep 12 '21 13:09 Eboubaker

@Eboubaker Upgrade your node to the latest (14.17.6)

antoshalee avatar Sep 13 '21 09:09 antoshalee

I'm getting this


$ npx tailwindcss init -P
Unexpected token import

```[
node -v
v8.16.2
npx -v
10.2.2](`url`)

intelligentwolf avatar Aug 08 '23 06:08 intelligentwolf

@nbtafelberg you are on Node 8, the current version of Node is Node 20. The current LTS version is Node 18.

Node 8 was end of life in 2017. I strongly recommend to upgrade all your projects asap to ensure you are on a modern version with all the necessary security fixes applied.

RobinMalfait avatar Aug 08 '23 11:08 RobinMalfait