title: Creating an NPM package out of a Create React App and publish on Gitlab
body: <p>This might be a stupid question but I really don't know what is going on.</p>
  <p>I have created a React App with <code>crate react app</code> and uploaded it as a private repository to my <strong>GitLab</strong> account. The (default) React App starts as expected after running <code>yarn start</code> locally at <code>localhost:3000</code>. Since I need to create packages for ongoing code development, I have started to get into using the <strong>NPM Registry</strong> at GitLab. This was actually quite easy:</p>
  <ol>
  <li>create an <code>.npmrc</code> within the app directory</li>
  <li>add <strong>scope</strong>, <strong>repository ID</strong> and <strong>auth token</strong> (I have chosen to use a personal token) like so</li>
  </ol>
  <pre class="lang-java prettyprint-override"><code># Set URL for your scoped packages.
  # This is my top-level group at GitLab
  
  @scope:registry=https://gitlab.com/api/v4/packages/npm/
  
  
  # Add the token for the scoped packages URL.
  # I have chosen to use the personal key -&gt; more infos: https://docs.gitlab.com/ee/user/packages/npm_registry/
  
  //gitlab.com/api/v4/packages/npm/:_authToken=&quot;&lt;auth-token&gt;&quot;
  
  
  # Add token for uploading to the registry.
  
  //gitlab.com/api/v4/projects/&lt;project-ID&gt;/packages/npm/:_authToken=&quot;&lt;auth-token&gt;&quot;
  </code></pre>
  <ol start="3">
  <li>run <code>npm init</code> to initialise the package</li>
  <li>add the <strong>scope</strong> and a <strong>publishConfig</strong> to the <code>package.json</code> like so</li>
  </ol>
  <pre class="lang-java prettyprint-override"><code>{
    &quot;name&quot;: &quot;@scope/package-name&quot;,
    &quot;version&quot;: &quot;0.1.0&quot;,
    &quot;main&quot;: &quot;index.js&quot;, &lt;-- the entry point 
    ...
    &quot;publishConfig&quot;: {
      &quot;@scope:registry&quot;: &quot;https://gitlab.com/api/v4/projects/&lt;project-ID&gt;/packages/npm/&quot;
    }
  }
  </code></pre>
  <ol start="5">
  <li>run <code>npm publish</code></li>
  </ol>
  <p>Like I've said, the package gets uploaded to my GitLab account, under the <em>scope</em> fine. The only problem I have now is that running <code>yarn start</code> from my local repo does result in a blank white screen. I have also realised that yarn does not redirect to <code>http://localhost:3000</code> anymore but to <code>http://localhost:3000/scope/repository-name</code>.</p>
  <p>What am I missing here?</p>
  <p>Thanks!</p>