<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yuri Ramos</title>
    <description>The latest articles on DEV Community by Yuri Ramos (@yurirxmos).</description>
    <link>https://dev.to/yurirxmos</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3323414%2F5202c98a-c820-4b57-9951-30fa58153998.png</url>
      <title>DEV Community: Yuri Ramos</title>
      <link>https://dev.to/yurirxmos</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yurirxmos"/>
    <language>en</language>
    <item>
      <title>Why You Should Use npm (and Not pnpm... Yet) to Build Electron + React + Vite + Tailwind Apps</title>
      <dc:creator>Yuri Ramos</dc:creator>
      <pubDate>Fri, 04 Jul 2025 18:16:41 +0000</pubDate>
      <link>https://dev.to/yurirxmos/why-you-should-use-npm-and-not-pnpm-yet-to-build-electron-react-vite-tailwind-apps-4oc9</link>
      <guid>https://dev.to/yurirxmos/why-you-should-use-npm-and-not-pnpm-yet-to-build-electron-react-vite-tailwind-apps-4oc9</guid>
      <description>&lt;p&gt;If you’ve ever wanted to build a desktop app using tools you already know from the web — React, Vite, Tailwind — you’re going to love this stack. I recently built a desktop tool using these exact technologies and it was smoother than I expected.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Here's the catch: use &lt;code&gt;npm&lt;/code&gt;, not &lt;code&gt;pnpm&lt;/code&gt;, especially when you're working with Electron. This is important if you're just starting out, which applies to me and probably to you too.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let’s break down why.&lt;/p&gt;




&lt;h2&gt;
  
  
  First reason: The Stack
&lt;/h2&gt;

&lt;p&gt;We’re talking about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Electron&lt;/strong&gt; – to create desktop apps with web tech&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React&lt;/strong&gt; – for building UI&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vite&lt;/strong&gt; – for super-fast development&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tailwind CSS&lt;/strong&gt; – for styling with ease&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;npm&lt;/strong&gt; – to manage it all&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can spin all of this up in under 10 minutes. But the way you install and structure your dependencies &lt;em&gt;matters&lt;/em&gt;. That’s where &lt;code&gt;npm&lt;/code&gt; vs &lt;code&gt;pnpm&lt;/code&gt; comes in.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why you should use &lt;code&gt;npm&lt;/code&gt;?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  It’s Familiar
&lt;/h3&gt;

&lt;p&gt;If you've done anything with JavaScript, you’ve used &lt;code&gt;npm&lt;/code&gt;. The learning curve is basically zero.&lt;/p&gt;

&lt;h3&gt;
  
  
  It Plays Nice with Electron
&lt;/h3&gt;

&lt;p&gt;Electron expects dependencies to be laid out in a certain way. When you package your Electron app for production, tools like &lt;code&gt;electron-builder&lt;/code&gt; scan your &lt;code&gt;node_modules&lt;/code&gt; to include required files.&lt;/p&gt;

&lt;p&gt;With &lt;code&gt;npm&lt;/code&gt;, that's straightforward. The &lt;code&gt;node_modules&lt;/code&gt; folder is flat and easy to traverse.&lt;/p&gt;

&lt;p&gt;But…&lt;/p&gt;




&lt;h2&gt;
  
  
  Why &lt;code&gt;pnpm&lt;/code&gt; Can Cause Headaches with Electron
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;pnpm&lt;/code&gt; is great — it's fast, efficient, and deduplicates packages like a boss. But its performance gain comes from a &lt;strong&gt;symlinked folder structure&lt;/strong&gt;, not the flat &lt;code&gt;node_modules&lt;/code&gt; you're used to.&lt;/p&gt;

&lt;p&gt;That’s where the pain begins.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Problem:
&lt;/h3&gt;

&lt;p&gt;Electron builders (like &lt;code&gt;electron-builder&lt;/code&gt;) or runtime expectations often &lt;strong&gt;fail to properly resolve packages&lt;/strong&gt; when they’re symlinked in the way &lt;code&gt;pnpm&lt;/code&gt; sets them up. You might get weird runtime errors like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Cannot find module 'electron'&lt;/code&gt; (i hate this one)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Module not found: path-to-your-lib&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Your app builds but crashes on startup&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Or even worse: everything works in dev, but breaks in production packaging&lt;/p&gt;

&lt;p&gt;Unless you’re experienced with &lt;code&gt;pnpm&lt;/code&gt; overrides or ready to tinker with &lt;code&gt;buildResources&lt;/code&gt;, &lt;code&gt;asarUnpack&lt;/code&gt;, and manual packaging configs — &lt;strong&gt;stick with &lt;code&gt;npm&lt;/code&gt;&lt;/strong&gt; to avoid that rabbit hole.&lt;/p&gt;




&lt;h2&gt;
  
  
  Okay, you convinced me to use npm. Now What?
&lt;/h2&gt;

&lt;p&gt;You can scaffold the whole thing like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm create vite@latest my-app &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nt"&gt;--template&lt;/span&gt; react
&lt;span class="nb"&gt;cd &lt;/span&gt;my-app
npm &lt;span class="nb"&gt;install
&lt;/span&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--save-dev&lt;/span&gt; electron concurrently wait-on electron-builder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set up your Electron main process (e.g. in &lt;code&gt;electron/main.js&lt;/code&gt;), add Tailwind, wire up your &lt;code&gt;package.json&lt;/code&gt; scripts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"dev"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"concurrently &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;vite&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;npm:electron-dev&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"electron-dev"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"wait-on http://localhost:5173 &amp;amp;&amp;amp; electron ."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"build"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"vite build &amp;amp;&amp;amp; electron-builder"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqtzlj2eun2o24hdl4fv8.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqtzlj2eun2o24hdl4fv8.gif" alt="Image description" width="400" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Boom. You’re building desktop apps.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;I really like &lt;code&gt;pnpm&lt;/code&gt;, it’s fast, smart, and a great choice for most projects. But if you’re using &lt;strong&gt;Electron&lt;/strong&gt;, especially with tools like &lt;code&gt;electron-builder&lt;/code&gt;, do yourself a favor and stick with &lt;code&gt;npm&lt;/code&gt; until you're comfortable with Electron’s internals.&lt;/p&gt;

&lt;p&gt;This combo — Electron + React + Vite + Tailwind + npm — is powerful, fast to set up, and surprisingly stable. Whether you’re building an internal tool, a personal project, or your next big product — it just works.&lt;/p&gt;

</description>
      <category>electron</category>
      <category>react</category>
      <category>vite</category>
      <category>tailwindcss</category>
    </item>
  </channel>
</rss>
