title: Cannot read property 'startsWith' of null in npm install
body: <p>I searched this issue everywhere. But still couldn't find an answer. Most of answers say there's a problem with proxy. When I try to use <code>npm install -g package-name</code> an error is occurred.</p>
  
  <pre><code>npm ERR! Cannot read property 'startsWith' of null
  npm ERR! A complete log of this run can be found in:
  npm ERR!     C:\Users\User\AppData\Roaming\npm-cache\_logs\2018-03-27T14_55_06_994Z-debug.log
  </code></pre>
  
  <p>Here is the .log file</p>
  
  <pre><code>0 info it worked if it ends with ok
  1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
  1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
  1 verbose cli   'install',
  1 verbose cli   '-g',
  1 verbose cli   '@angular/cli' ]
  2 info using npm@5.6.0
  3 info using node@v8.10.0
  4 verbose npm-session bd0a5d284789daec
  5 silly install loadCurrentTree
  6 silly install readGlobalPackageData
  7 silly fetchPackageMetaData error for @angular/cli@latest Cannot read property 'startsWith' of null
  8 verbose stack TypeError: Cannot read property 'startsWith' of null
  8 verbose stack     at getProxy (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\agent.js:164:25)
  8 verbose stack     at getAgent (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\agent.js:37:19)
  8 verbose stack     at remoteFetch (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\index.js:310:17)
  8 verbose stack     at opts.cacheManager.match.then.res (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\index.js:172:14)
  8 verbose stack     at tryCatcher (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
  8 verbose stack     at Promise._settlePromiseFromHandler (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
  8 verbose stack     at Promise._settlePromise (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
  8 verbose stack     at Promise._settlePromise0 (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
  8 verbose stack     at Promise._settlePromises (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
  8 verbose stack     at Promise._fulfill (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:638:18)
  8 verbose stack     at Promise._resolveCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:432:57)
  8 verbose stack     at Promise._settlePromiseFromHandler (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:524:17)
  8 verbose stack     at Promise._settlePromise (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
  8 verbose stack     at Promise._settlePromise0 (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
  8 verbose stack     at Promise._settlePromises (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
  8 verbose stack     at Promise._fulfill (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:638:18)
  9 verbose cwd C:\
  10 verbose Windows_NT 10.0.16299
  11 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli"
  12 verbose node v8.10.0
  13 verbose npm  v5.6.0
  14 error Cannot read property 'startsWith' of null
  15 verbose exit [ 1, true ]
  </code></pre>
  
  <p>Versions
  node - 8.10.0
  npm - 5.6.0</p>