pnpm peer dependency issue w/ tailwind
See original GitHub issuecreating a fresh sveltekit repo (Skeleton app, Typescript support) gives a peer dependency error for postcss when initialized via pnpm and pnpx.
pnpm init svelte@next new-repo
cd new-repo
pnpx svelte-add@latest tailwindcss
pnpm i
during pnpx svelte-add@latest tailwindcss
:
✔ Install the following package: svelte-add@latest? (Y/n) · true
Packages: +65
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
Content-addressable store is at: /Users/andrew/.pnpm-store/v3
Virtual store is at: node_modules/.pnpm
Progress: resolved 65, reused 65, downloaded 0, added 65, done
/Users/andrew/.pnpm-store/v3/tmp/_npx/71859/5:
+ svelte-add 2022.1.0-5.0
➕ Svelte Add (Version 2022.01.05.00)
The project directory you're giving to this command cannot be determined to be guaranteed fresh — maybe it is, maybe it isn't. If any issues arise after running this command, please try again, making sure you've run it on a freshly initialized SvelteKit or Vite–Svelte app template.
UndefinedParserError$1: No parser could be inferred for file: /Users/andrew/Code/scratchwork/my-repo/src/routes/__layout.svelte
at normalize$1 (/Users/andrew/.pnpm-store/v3/tmp/_npx/71859/5/node_modules/.pnpm/prettier@2.5.1/node_modules/prettier/index.js:13043:15)
at formatWithCursor$1 (/Users/andrew/.pnpm-store/v3/tmp/_npx/71859/5/node_modules/.pnpm/prettier@2.5.1/node_modules/prettier/index.js:14746:46)
at /Users/andrew/.pnpm-store/v3/tmp/_npx/71859/5/node_modules/.pnpm/prettier@2.5.1/node_modules/prettier/index.js:60959:12
at Object.format (/Users/andrew/.pnpm-store/v3/tmp/_npx/71859/5/node_modules/.pnpm/prettier@2.5.1/node_modules/prettier/index.js:60979:12)
at updateFile (file:///Users/andrew/.pnpm-store/v3/tmp/_npx/71859/5/node_modules/.pnpm/svelte-add@2022.1.0-5.0/node_modules/svelte-add/update.js:60:25)
at async updateSvelte (file:///Users/andrew/.pnpm-store/v3/tmp/_npx/71859/5/node_modules/.pnpm/svelte-add@2022.1.0-5.0/node_modules/svelte-add/update.js:227:2)
at async setupStyleLanguage (file:///Users/andrew/.pnpm-store/v3/tmp/_npx/71859/5/node_modules/.pnpm/svelte-add@2022.1.0-5.0/node_modules/svelte-add/adder-tools.js:199:3)
at async run (file:///Users/andrew/.pnpm-store/v3/tmp/_npx/71859/5/node_modules/.pnpm/svelte-add@2022.1.0-5.0/node_modules/svelte-add/adders/postcss/__run.js:46:2)
at async runAdder (file:///Users/andrew/.pnpm-store/v3/tmp/_npx/71859/5/node_modules/.pnpm/svelte-add@2022.1.0-5.0/node_modules/svelte-add/index.js:832:2)
at async main (file:///Users/andrew/.pnpm-store/v3/tmp/_npx/71859/5/node_modules/.pnpm/svelte-add@2022.1.0-5.0/node_modules/svelte-add/cli.js:92:4)
PostCSS
✅ successfully set up and repaired (it looks like it was in a broken setup before this command was run)!
Create or find an existing issue at https://github.com/svelte-add/svelte-add/issues if this is wrong.
Tailwind CSS
✅ successfully set up!
Create or find an existing issue at https://github.com/svelte-add/svelte-add/issues if this is wrong.
Run pnpm install to install new dependencies, and then reload your IDE before starting your app.
during pnpm i
:
WARN Issues with peer dependencies found
.
├─┬ svelte-check
│ └─┬ svelte-preprocess
│ └── ✕ missing peer postcss@"^7 || ^8"
├─┬ autoprefixer
│ └── ✕ missing peer postcss@^8.1.0
└─┬ tailwindcss
├── ✕ missing peer postcss@^8.0.9
├─┬ postcss-js
│ └── ✕ missing peer postcss@^8.3.3
└─┬ postcss-nested
└── ✕ missing peer postcss@^8.2.14
Peer dependencies that should be installed:
postcss@">=8.3.3 <9.0.0"
installing using npm and npx has no issues.
npm init svelte@next my-repo
cd my-repo
npx svelte-add@latest tailwindcss
npm i
(though rm
’ing and reinstalling via pnpm
gives the same peerp dependency error
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How peers are resolved - PNPM
Peer dependencies are resolved from dependencies installed higher in the dependency graph, since they share the same version as their parent. That means...
Read more >if you don't want pnpm to fail on peer dependency issues, add ...
Peer dependencies are resolved from dependencies installed higher in the dependency graph, since they share the same version as their parent. That means...
Read more >A story of how we migrated to pnpm - ‹div›RIOTS
It all started with me trying to improve our Continuous Integration pipeline. I'm a strong believer in having proper CI - the threshold...
Read more >Dependency errors when running standard Tailwind CSS ...
I had the same problem while configuring it with react app but it is solved when I use yarn instead of npm yarn...
Read more >you must install peer dependencies yourself Code Example
npm WARN codelyzer@6.0.1 requires a peer of tslint@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself. typescript by devops ......
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
This is because of https://github.com/svelte-add/svelte-add/issues/159. I don’t think there’s any value in showing this error because it causes confusion, so I’ll hide it in a future update.
Similarly, I’ll make the PostCSS adder install
postcss
again just so confusing warnings aren’t shown (even though there is no functional impact).Closed by https://github.com/svelte-add/svelte-add/commit/ae19aeafabee44290b2989ae56fe37dafe963e1e
Closed by https://github.com/svelte-add/postcss/commit/ce1df397a7464a876547ed4a21be07916cbd2275