Issues with Tailwind CSS Compilation on Ubuntu

To install Tailwind CSS on an Ubuntu system using npm, you will need to have Node.js and npm (Node Package Manager) installed on your system. If you haven't already installed these, you can do so by following these steps:

sudo apt-get install -y nodejs

sudo apt install npm

Running Commands with an Older Version of Node.js and Tailwind Installed

npx tailwindcss -i static/input.css -o static/output.css

Then you get somthing like

Unexpected token '?'


I manage my Node.js versions with NVM, which is straightforward to install and user-friendly.

NVM (Node Version Manager) is indeed a powerful tool for managing multiple Node.js versions on a single machine. It allows you to switch between versions easily and manage different projects that may require different Node.js environments. Here's a quick overview of how to set it up and use it: sudo apt purge nodejs npm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
nvm install node nvm alias default node
npx tailwindcss -i static/input.css -o static/output.css

Rebuilding...
NVM makes it simple to manage different projects that require different Node.js versions without needing to manually adjust system paths or deal with conflicting dependencies. It's a must-have tool for any Node.js developer's toolkit!
nvm ls-remote


Comments