<p>I am learning microservices with docker and kubernetes by simple project, now I am trying to use local registry installed as a docker container with helm. I published my package/library in my local registry (I am using verdaccio) and successfully installed it on my current project with command &quot;npm install @mycompany/mylibs --registry=http://localhost:4873&quot;. My problem is when I am trying to deploy my project to kubernetes via skaffold, it fails to download the packages from package.json config file. I tried both setting up .npmrc file to project's root folder and default registry on verdaccio conf file but all fail. Is there anyone has encountered same problem as mine and how to fix it. Somebody help please. Thank you</p>
<p>This is my project structure :</p>
<pre><code>MyProject
|-auth (this service has dependency to @mycompany/mylibs)
| |-src
| |-Dockerfile
| |-package.json
|
|-infra/kube
| |-auth-depl.yaml
| |-ingress-srv.yaml


MySharedLibrary
| |-src
| |-package.json
</code></pre>
<p>auth's package.json :</p>
<pre><code>{
  &quot;name&quot;: &quot;auth&quot;,
  &quot;version&quot;: &quot;1.0.0&quot;,
  &quot;description&quot;: &quot;&quot;,
  &quot;main&quot;: &quot;index.js&quot;,
  &quot;scripts&quot;: {
    &quot;start&quot;: &quot;ts-node-dev src/index.ts&quot;,
    &quot;test&quot;: &quot;jest --watchAll --no-cache&quot;
  },
  &quot;jest&quot;: {
    &quot;preset&quot;: &quot;ts-jest&quot;,
    &quot;testEnvironment&quot;: &quot;node&quot;,
    &quot;setupFilesAfterEnv&quot;: [
      &quot;./src/test/setup.ts&quot;
    ]
  },
  &quot;keywords&quot;: [],
  &quot;author&quot;: &quot;&quot;,
  &quot;license&quot;: &quot;ISC&quot;,
  &quot;dependencies&quot;: {
    &quot;@mycompany/mylibs&quot;: &quot;^1.0.3&quot;,
    &quot;@types/cookie-session&quot;: &quot;^2.0.42&quot;,
    &quot;@types/express&quot;: &quot;^4.17.9&quot;,
    &quot;@types/jsonwebtoken&quot;: &quot;^8.5.0&quot;,
    &quot;cookie-session&quot;: &quot;^1.4.0&quot;,
    &quot;express&quot;: &quot;^4.17.1&quot;,
    &quot;express-async-errors&quot;: &quot;^3.1.1&quot;,
    &quot;express-validator&quot;: &quot;^6.7.0&quot;,
    &quot;jsonwebtoken&quot;: &quot;^8.5.1&quot;,
    &quot;mariadb&quot;: &quot;^2.5.1&quot;,
    &quot;mysql2&quot;: &quot;^2.2.5&quot;,
    &quot;sequelize&quot;: &quot;^6.3.5&quot;,
    &quot;ts-node-dev&quot;: &quot;^1.0.0&quot;,
    &quot;typescript&quot;: &quot;^4.1.2&quot;
  },
  &quot;devDependencies&quot;: {
    &quot;@types/jest&quot;: &quot;^26.0.19&quot;,
    &quot;@types/supertest&quot;: &quot;^2.0.10&quot;,
    &quot;jest&quot;: &quot;^26.6.3&quot;,
    &quot;supertest&quot;: &quot;^6.0.1&quot;,
    &quot;ts-jest&quot;: &quot;^26.4.4&quot;
  }
}

</code></pre>
<p>I am using:</p>
<p>Windows 10 PC as main host for docker and where the project hosted.</p>
<p>docker version  19.03.13</p>
<p>npm version 6.14.6</p>
<p>verdaccio 4.12.0</p>
<p>helm 3.5.3</p>
<p>skaffold 1.13.0</p>
<p>The error message after I deploy my project with <code>skaffold dev</code> :</p>
<pre><code>npm ERR! 404 Not Found - GET https://registry.npmjs.org/@mycompany%2fmylibs - Not found
npm ERR! 404
npm ERR! 404  '@mycompany/mylibs@^1.0.3' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'app'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
</code></pre>
<p>I want my deployment process each container could find all required dependencies on local registry (http://localhost:4873) and when it couldn't find them, it should try to reach public npm (<a href="https://registry.npmjs.org" rel="nofollow noreferrer">https://registry.npmjs.org</a> or npmjs.com).</p>

nomib
<p>Thanks everyone for helping me, I solved this problem by reconfiguring my Dockerfile on auth service by adding line:</p>
<pre><code>RUN npm config set registry http://&lt;the_local_registry_container_IP&gt;:4873
</code></pre>
<p>I am successful building the container but it raised new issues &quot;request has been deprecated, see github.com/request/request/issues/3142&quot; cause of I am using supertest. I don't know why I am still searching for the main problem. In another occasion if I build it with public npm repo, it doesn't raise that problem.</p>
