title: Why committing package-lock.json eliminates npm SignalR installation error?
body: <p>I upgraded my .Net Core 2.0 project to <strong>2.1</strong>. Then I tried to install <strong>SignalR</strong> (specifically the client library):</p>
  
  <p>Inside Visual Studio 2017 package manager console, I initialized package.json (actually I do not know what does this file do):</p>
  
  <pre><code>PM&gt; npm init -y
  </code></pre>
  
  <p>Then I tried to install signalR:</p>
  
  <pre><code>PM&gt; npm install @aspnet/signalr
  </code></pre>
  
  <p>Then I get this error:</p>
  
  <pre><code>npm : npm notice created a lockfile as package-lock.json. You should commit this file.
  At line:1 char:1
  + npm install @aspnet/signalr
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : NotSpecified: (npm notice crea...mmit this file.:String) [], RemoteException
      + FullyQualifiedErrorId : NativeCommandError
  
  + @aspnet/signalr@1.0.0
  </code></pre>
  
  <p>After that, I committed both package.json and package-lock.json files in git, and then tried to reinstall the package. Now the error has gone.</p>
  
  <p>What was that error and why it is gone by committing?</p>