title: How do I cURL a npm package into a npm repository onto my local nexus?
body: <p>I created a simple npm package in a directory with the following structure:</p>
  
  <p>random-number-generator (directory name)</p>
  
  <ul>
  <li>package.json </li>
  <li>index.js</li>
  </ul>
  
  <p>I then used <code>npm pack</code> to create my <code>random-number-generator-1.0.0.tgz</code> file. I also have a npm repository called npm-hosted.</p>
  
  <p>I need to be able to cURL this package into the npm-hosted repository on my local nexus. I have tried the following command:</p>
  
  <p><code>curl -u user:password -X POST "http://localhost:8081/service/rest/v1/components?repository=npm-hosted" -F "npm.asset=C:\Projects\npm-nexus-test\random-number-generator\random-number-generator-1.0.0.tgz" -v</code></p>
  
  <p>But I get the following error from the nexus.exe window:</p>
  
  <pre><code>2019-09-08 18:57:50,174+0100 WARN  [qtp901422593-77] admin org.sonatype.nexus.siesta.internal.UnexpectedExceptionMapper - (ID dbf90a0a-8c94-4e27-bd20-c902a6f8367f) Response: [500] 'ERROR: (ID dbf90a0a-8c94-4e27-bd20-c902a6f8367f) java.lang.NullPointerException'; mapped from: java.lang.NullPointerException
  2019-09-08 18:59:40,793+0100 INFO  [qtp901422593-79] admin org.sonatype.nexus.repository.upload.internal.UploadManagerImpl - Uploading component with parameters: repository="npm-hosted" format="npm"
  2019-09-08 18:59:40,795+0100 INFO  [qtp901422593-79] admin org.sonatype.nexus.repository.upload.internal.UploadManagerImpl - Asset with parameters: file="null"
  2019-09-08 18:59:40,800+0100 WARN  [qtp901422593-79] admin org.sonatype.nexus.siesta.internal.UnexpectedExceptionMapper - (ID 9db49b76-e338-4aa6-850c-d2deebd15dba) Unexpected exception: java.lang.NullPointerException
  java.lang.NullPointerException: null
  </code></pre>
  
  <p>And this error from curl:</p>
  
  <pre><code>curl -u admin:admin -X POST "http://localhost:8081/service/rest/v1/components?repository=npm-hosted" -F npm.asset=random-number-generator-1.0.0.tgz -v
  Note: Unnecessary use of -X or --request, POST is already inferred.
  *   Trying ::1...
  * TCP_NODELAY set
  *   Trying 127.0.0.1...
  * TCP_NODELAY set
  * Connected to localhost (127.0.0.1) port 8081 (#0)
  * Server auth using Basic with user 'admin'
  &gt; POST /service/rest/v1/components?repository=npm-hosted HTTP/1.1
  &gt; Host: localhost:8081
  &gt; Authorization: Basic YWRtaW46YWRtaW4=
  &gt; User-Agent: curl/7.55.1
  &gt; Accept: */*
  &gt; Content-Length: 177
  &gt; Expect: 100-continue
  &gt; Content-Type: multipart/form-data; boundary=------------------------2766893a4b807008
  &gt;
  &lt; HTTP/1.1 100 Continue
  &lt; HTTP/1.1 500 Server Error
  &lt; Date: Sun, 08 Sep 2019 18:13:25 GMT
  &lt; Server: Nexus/3.18.1-01 (OSS)
  &lt; X-Content-Type-Options: nosniff
  &lt; Content-Type: text/plain;charset=utf-8
  &lt; X-Siesta-FaultId: c3cc2a39-9db4-42fc-a11e-25e930ad3cdc
  &lt; Content-Length: 79
  * HTTP error before end of send, stop sending
  &lt;
  ERROR: (ID c3cc2a39-9db4-42fc-a11e-25e930ad3cdc) java.lang.NullPointerException* Closing connection 0
  </code></pre>
  
  <p>It looks like it can't find my file to upload even though I give it the absolute relative file path. Am I doing something wrong?</p>