title: Non-deterministic behavior of npm
body: <p>After running <code>npm install</code>, I have noticed that sometimes <code>package-lock.json</code> changes.</p>
  
  <p>This section:</p>
  
  <pre><code>  "dependencies": {
      "websocket": {
        "version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2",
        "from": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2",
        "requires": {
          "debug": "^2.2.0",
          "nan": "^2.3.3",
          "typedarray-to-buffer": "^3.1.2",
          "yaeti": "^0.0.6"
        }
      }
    }
  }
  </code></pre>
  
  <p>Changes to this:</p>
  
  <pre><code>  "dependencies": {
      "websocket": {
        "version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2",
        "from": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2",
        "requires": {
          "debug": "^2.2.0",
          "nan": "^2.3.3"
        }
      }
    }
  }
  </code></pre>
  
  <p>And when that happens, I get a runtime error:</p>
  
  <pre><code>module.js:538
      throw err;
      ^
  
  Error: Cannot find module 'typedarray-to-buffer'
      at Function.Module._resolveFilename (module.js:536:15)
      at Function.Module._load (module.js:466:25)
      at Module.require (module.js:579:17)
      at require (internal/module.js:11:18)
      at Object.&lt;anonymous&gt; (C:\Users\...\node_modules\web3-providers-ws\node_modules\websocket\lib\W3CWebSocket.js:18:16)
      at Module._compile (module.js:635:30)
      at Object.Module._extensions..js (module.js:646:10)
      at Module.load (module.js:554:32)
      at tryModuleLoad (module.js:497:12)
      at Function.Module._load (module.js:489:3)
  </code></pre>
  
  <p>After some debugging, this error is for <code>require("web3")</code> in my code.</p>
  
  <p>Here is the relevant section in my <code>package.json</code> file:</p>
  
  <pre><code>  "devDependencies": {
      "chai": "^4.1.2",
      "chai-as-promised": "^7.0.0",
      "bignumber.js": "^7.0.0",
      "decimal.js": "^10.0.0",
      "web3": "1.0.0-beta.34",
      "ethereumjs-testrpc-sc": "6.1.2",
      "ganache-cli": "6.1.0",
      "solidity-coverage": "0.4.14",
      "truffle": "4.1.3"
    }
  </code></pre>
  
  <p>How can I resolve this, and why does <code>npm</code> work differently from time to time?</p>