Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python manage.py tailwind start with SyntaxError: Unexpected token '.' #191

Open
junwenwaynepeng opened this issue Nov 27, 2023 · 2 comments

Comments

@junwenwaynepeng
Copy link

I follow the process in https://django-tailwind.readthedocs.io/en/latest/installation.html on my laptop, running windows 11, and everything goes smoothly. Then, I push it to my github repo and pull on the other device, running ubuntu 22.04. I have reset everything in settings.py. Because I already have a 'theme' app, so I cannot repeat the python manage.py tailwind init, but I carry out other steps. Until the last step, it returns the following error:

python manage.py 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

/home/r409/projects/SeeNetwork/theme/static_src/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. (/home/r409/projects/SeeNetwork/theme/static_src/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)

@Valgueiro
Copy link

I had this problem when running with node 12.x. When I changed to a newer version (20) it worked as expected

@junwenwaynepeng
Copy link
Author

Yes. After I googled it for a couple of days. I realized it is not Django-tailwind's problem. However, my error was not vanishing after I upgraded to the latest version of node. Interestingly, it worked on Windows, but failed on Ubuntu. Usually, it was the other way. I suggested the authors to write a troubleshooting for this issue, because it seems like a common problem, and will make users who are not familiar with node.js (like me) misunderstand the problem is from Django-tailwind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@Valgueiro @junwenwaynepeng and others