Search code examples

Cant deploy django-tailwind development server

Ive followed django-tailwind installation docs and did everything until last step, however, when I try to run 'python tailwind start', I got the following error:

`(venv) catatal@catatal-Predator-PH315-52:~/dev/portal_prosesmt$ python tailwind start

> [email protected] start
> npm run dev

> [email protected] dev
> cross-env NODE_ENV=development tailwindcss --postcss -i ./src/styles.css -o ../static/css/dist/styles.css -w

        } = getOptions(name, options ?? {}, false);

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/catatal/dev/portal_prosesmt/theme/static_src/node_modules/postcss-load-config/src/index.js:6:16)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)`

My node version is: 12.22.9; My npm version is: 8.5.1; Ubuntu is 20.0.4.

Ive changed postcss.config.js file from:

`module.exports = {
  plugins: {
    "postcss-import": {},
    "postcss-simple-vars": {},
    "postcss-nested": {}


`export const plugins = {
  "postcss-import": {},
  "postcss-simple-vars": {},
  "postcss-nested": {}

As suggested from VS Code, however it didnt solve the problem.


  • I solved it! Just needed to update node.js version. Updating it to v20.12.0 did the trick.