<?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: Markus René Einicher</title>
    <description>The latest articles on DEV Community by Markus René Einicher (@einicher).</description>
    <link>https://dev.to/einicher</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%2F75459%2Fa10080f2-5e00-499c-bfad-a747d5c97fdd.png</url>
      <title>DEV Community: Markus René Einicher</title>
      <link>https://dev.to/einicher</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/einicher"/>
    <language>en</language>
    <item>
      <title>npm local packages - one big fuckup?</title>
      <dc:creator>Markus René Einicher</dc:creator>
      <pubDate>Tue, 07 Apr 2020 15:41:01 +0000</pubDate>
      <link>https://dev.to/einicher/npm-local-packages-one-big-fuckup-1fd8</link>
      <guid>https://dev.to/einicher/npm-local-packages-one-big-fuckup-1fd8</guid>
      <description>&lt;p&gt;Using local packages with PHP/Composer is very simple: you just add a local folder to &lt;code&gt;repositories&lt;/code&gt; in your projects &lt;code&gt;package.json&lt;/code&gt; file and thats it. Composer then checks your local repo before it lookups packagist. Any local package behaves like an actual package from the server. Meaning composer is linking it and if you change the version inside package.json it understands there is an update. All dependencies go where they always go - into the vendor folder.&lt;/p&gt;

&lt;p&gt;With npm local packages are just hell. You can add a lot of cool stuff to your projects &lt;code&gt;package.json&lt;/code&gt; like http links to package archives, or even git repo urls. All of those behave the same. Packages are downloaded into your projects &lt;code&gt;node_modules&lt;/code&gt; folder, all dependencies are there, node finds them easily.&lt;/p&gt;

&lt;p&gt;Just with local packages its getting weird: When you add a local package to your &lt;code&gt;package.json&lt;/code&gt;, you do that by giving a local file system path (instead a version number). Then, when you do &lt;code&gt;npm install&lt;/code&gt;, it suddenly installs all dependencies of you local package into a new created &lt;code&gt;node_modules&lt;/code&gt; folder inside that package, not inside your project. With a npm package, a http or a git url it would never do that, simply because it does not have write access on that remote source. In a local package it just goes haywire. When you put several local packages in your &lt;code&gt;package.json&lt;/code&gt; you end up with a separate node_modules folder in every single one of them. Insane.&lt;/p&gt;

&lt;p&gt;Then there is npm link. No idea who came up with that. Its the same misbehavior, just on a global scale. I find tons of questions about this, but no real solution. How can an ecosystem like npm become that big like that?&lt;/p&gt;

&lt;p&gt;I think node and JavaScript are very important for the internets future since server and browser side development grow closer every second. There are just so many frustrating flaws. &lt;/p&gt;

</description>
      <category>npm</category>
      <category>node</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
