"npx svelte-add postcss" (or tailwindcss) fails with "The configuration file could not be found"
See original GitHub issueOn latest sveltekit, getting the following errors when trying to use svelte-add to add tailwindcss or postcss.
npx svelte-add tailwindcss --jit
Need to install the following packages:
svelte-add
Ok to proceed? (y) y
[ info ] Applying preset svelte-add/tailwindcss.
[ error ] The configuration file could not be found (tried in /var/folders/j4/3_1h9_mn6w5g4p438nym2vl40000gn/T/tmp-12200-fEh58kp9FH25).
This was talked about in Discord but I could not find a ticket so Iβm reporting here. Hopefully this is the right place to report!
System info:
npx envinfo --system --npmPackages svelte,rollup,webpack --binaries --browsers
System:
OS: macOS 11.2
CPU: (8) arm64 Apple M1
Memory: 84.34 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.3.0 - /var/folders/j4/3_1h9_mn6w5g4p438nym2vl40000gn/T/fnm_multishells/9404_1623953947746/bin/node
npm: 7.15.1 - /var/folders/j4/3_1h9_mn6w5g4p438nym2vl40000gn/T/fnm_multishells/9404_1623953947746/bin/npm
Browsers:
Brave Browser: 91.1.25.72
Chrome: 91.0.4472.106
Safari: 14.0.3
npmPackages:
svelte: ^3.34.0 => 3.38.2
npm ls
βββ @sveltejs/kit@1.0.0-next.115
βββ @typescript-eslint/eslint-plugin@4.27.0
βββ @typescript-eslint/parser@4.27.0
βββ eslint-config-prettier@8.3.0
βββ eslint-plugin-svelte3@3.2.0
βββ eslint@7.28.0
βββ prettier-plugin-svelte@2.3.0
βββ prettier@2.2.1
βββ svelte-check@2.1.0
βββ svelte-preprocess@4.7.3
βββ svelte@3.38.2
βββ tslib@2.3.0
βββ typescript@4.3.3
Repro:
npm init svelte@next myapp
cd myapp
npm i
npx svelte-add tailwindcss --jit # or just npx svelte-add postcss
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
PostCSS configuration was not passed or is invalid Β· Issue #470
Describe the bug I have an issue when I'd like to use the tailwind @apply syntax within a Svelte template: It works without...
Read more >Installation - Tailwind CSS
The simplest and fastest way to get up and running with Tailwind CSS from scratch is with the Tailwind CLI tool.
Read more >Error: PostCSS plugin tailwindcss requires PostCSS 8
I tried to uninstall postcss and tailwindcss but it does not work. Need help. Module build failed (from ./node_modules/postcss-loader/src/index.
Read more >How to Set Up SvelteKit with Tailwind CSS
A quick 3 step guide for myself on how to set up Svelte with Tailwind CSS. Tagged with svelte, tailwindcss, javascript.
Read more >How to Use Tailwind on a Svelte Site | CSS-Tricks
Autoprefixer is a PostCSS plugin that goes through your code adding vendor prefixes to your CSS rules (Tailwind does not do thisΒ ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It sounds like
npx
is using an old version of the package (maybe because of annpm audit
problem). Other people have reported problems that occur for the same reason.I do not know whether or not it works to do
npx svelte-add@latest
instead of justnpx svelte-add
, but try that and let me know if it does, please.Otherwise, you can find the latest version of the package at https://github.com/svelte-add/svelte-add/tags and ensure
npx
uses it likenpx svelte-add@2021.06.15.01
Those are not the right ways to write it:
npx svelte-add@latest tailwindcss
andnpx svelte-add@2021.06.15.01 tailwindcss
.