Unknown browser query when trying to watch files for tailwindcss

37 views Asked by At

I'm trying to run npx tailwindcss -i ./src/input.css -o ./dist/output.css --watch but it gives me this error:

Error [BrowserslistError]: Unknown browser query `var updateDb = require('update-browserslist-db')`. Maybe you are using old Browserslist or made typo in query.
    at unknownQuery (/home/blutu/Coding/node_modules/tailwindcss/peers/index.js:9235:14)
    at Function.select (/home/blutu/Coding/node_modules/tailwindcss/peers/index.js:10055:19)
    at /home/blutu/Coding/node_modules/tailwindcss/peers/index.js:9271:33
    at Array.reduce (<anonymous>)
    at resolve (/home/blutu/Coding/node_modules/tailwindcss/peers/index.js:9264:38)
    at browserslist (/home/blutu/Coding/node_modules/tailwindcss/peers/index.js:9352:25)
    at Browsers.parse (/home/blutu/Coding/node_modules/tailwindcss/peers/index.js:10192:16)
    at new Browsers (/home/blutu/Coding/node_modules/tailwindcss/peers/index.js:10181:30)
    at loadPrefixes (/home/blutu/Coding/node_modules/tailwindcss/peers/index.js:18241:24)
    at Object.prepare (/home/blutu/Coding/node_modules/tailwindcss/peers/index.js:18251:26) {
  browserslist: true
}
^C

my os is Linux mint and my NodeJS version is 21 (i installed it with Nvm)

I tried using NodeJS 18 and also tried to reinstall the tailwindcss package (npm i -d tailwindcss). I also deleted package.json and package-lock.json. Nothing helped.

1

There are 1 answers

0
Mahmoud Zenhom On

The error says: Maybe you are using an old Browserslist or made a typo in a query

You can try to update the browser list by using:

npx update-browserslist-db@latest 

npm i browserslist@latest