vue-cli-plugin-tailwind icon indicating copy to clipboard operation
vue-cli-plugin-tailwind copied to clipboard

tailwind.config.js file not generated on Windows

Open DevTony101 opened this issue 5 years ago • 17 comments

Hi! I'm having the same problem described on issue #26 , same error, I have updated the Vue CLI to verion 4.9.6 but it dit not fix the error. I'm running vue add tailwind on a freshly created project using the vue ui tool.

DevTony101 avatar Dec 10 '20 00:12 DevTony101

I'm having the same issue on Windows 10 inside Webstorm when I enter: vue add tailwind. Even after having installed tailwind css with "npm install tailwindcss". Also when I create the tailwind.config.js file manually, it says it's there, asks to overwrite, deletes it and brings the same error (no such file or directory). My vue cli version is 4.5.10.

marijnwijbenga avatar Jan 14 '21 08:01 marijnwijbenga

I released a new version v2.0.5, can you check if this is still a problem.

forsartis avatar Jan 15 '21 14:01 forsartis

Testing on Windows 10, WebStorm 2020.3, the following error appeared:

snapshot

DevTony101 avatar Jan 15 '21 15:01 DevTony101

try to update your nodejs

DinoHuang0310 avatar Jan 21 '21 09:01 DinoHuang0310

I'm using node version 14.15.0

DevTony101 avatar Jan 22 '21 01:01 DevTony101

Have this issue, fixed it by removing spaces from file path directory of my source code.

johnmark14 avatar Aug 12 '21 17:08 johnmark14

Have this issue, fixed it by removing spaces from file path directory of my source code.

how?

NoChizPlz avatar Aug 19 '21 03:08 NoChizPlz

Have this issue, fixed it by removing spaces from file path directory of my source code.

how?

I just have this problem and after changing the folder name it works.

my previous path is E:\vue projects\project-1
after renaming folder, E:\vue-projects\project-1\

cyfung1031 avatar Sep 05 '21 08:09 cyfung1031

Is there a workaround other than removing spaces? Why discriminate users with spaces in username so much?

dreamscached avatar Sep 09 '21 18:09 dreamscached

проблема всё ещё есть "vue-cli-plugin-tailwind": "~2.0.6" Screenshot_20210918_004611

Magistr-Almaty avatar Sep 17 '21 18:09 Magistr-Almaty

Same issue here. I have tried it on both PC and laptop, same error. No space in my path. Using Vue cli 4.5.13 on Ubuntu.

Steps:

  • Created new vue project with vue create. Using Vue 3.
  • cd into folder, run vue add tailwind
  • error occurs

Note that if I create the config file manually, it actually deletes it first, then fails to create a new one and complains it doesn't exist. Clearly it has permission and the path is correct, or it couldn't delete it first. The generation is just failing. I have tried selecting both minimal and full in the options, both fail to generate.

aurelion314 avatar Sep 26 '21 21:09 aurelion314

I had this issue until I updated to the latest nodejs

k3d3 avatar Oct 04 '21 01:10 k3d3

I had this issue until I updated to the latest nodejs

Thanks, this was the problem!

The source of the problem is that apt-get does not install the latest version of nodejs. Since I had just ran apt-get, I thought I had everything up to date (and IMO its pretty dumb that it wasn't). Once I manually installed node version 14.18.0 (latest version here), everything worked.

aurelion314 avatar Oct 04 '21 02:10 aurelion314

Alright, to break this down, for everyone having this issue (especially on WSL or WSL 2) follow these steps:

  1. Update apt repository: sudo apt update -y
  2. Install Node's version manager curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash (Press :Q! do quit vim)
  3. Sourcing NVM source ~/.nvm/nvm.sh
  4. Installing the latest version of Node.js nvm install node
  5. Checking your Node.js version nvm ls
  6. Install Tailwind CSS with Vue CLI 3 vue add tailwind

This should work. you're welcome.

PS: If you now think that Step 1, sudo apt upgrade -y was entirely useless, you are right, but I am drunk and I'm just gonna leave it there.

PS2: If you mess up your node installation follow through those steps before attempting steps 1-6:

sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* ~/.npm
sudo rm -rf /usr/local/lib/node*
sudo rm -rf /usr/local/bin/node*
sudo rm -rf /usr/local/include/node*

sudo apt-get purge nodejs npm
sudo apt autoremove

PS3: I'm already regretting getting back into WebDev

stefanrows avatar Oct 08 '21 17:10 stefanrows

Have this issue, fixed it by removing spaces from file path directory of my source code.

This worked for me, thanks. But it will be great if it can be fixed in the upcoming updates, as I would not like to rename my folders and sub-folders.

karanodedra20 avatar Oct 14 '21 11:10 karanodedra20

Have this issue, fixed it by removing spaces from file path directory of my source code.

This was the culprit! I'm using @vue/cli 5.0.8 and the vue add tailwind command will only properly finish running the vue-cli-plugin-tailwind generator to create the tailwind.config.js if I remove all spaces from the current project path. So yes, I had to rename my directory path of my project to be able to successfully finish adding tailwind to a @vue/cli scaffolded project.

@forsartis Could you please check the generator code? I've been trying to find the issue here https://github.com/forsartis/vue-cli-plugin-tailwind/blob/master/generator/index.js but not sure where the problem is yet. I'm suspecting line 47 the proper path is not resolved correctly: const configPath = api.resolve(filenameTailwind);

lorand-horvath avatar Nov 22 '22 12:11 lorand-horvath

I am not able to overcome from this problem, I have done everything you guys told, but I am not able to get that freaking config.js file. Please help !!!!!!

PrajjwalR avatar Sep 04 '23 09:09 PrajjwalR

@PrajjwalR I recommend for you to switch from Vue CLI (webpack based) to Vite and you will not face this issue anymore.

lorand-horvath avatar Sep 04 '23 12:09 lorand-horvath