title: How to resolve NPM proxy Issue whilel running Node JS application
body: <p>I have installed Noed JS and NPM. I have cloned the repo from git and trying to run the app in local. But I am facing below proxy issue while running app.</p>
  
  <blockquote>
    <pre class="lang-none prettyprint-override"><code>npm install nodemon
  npm ERR! code ENOTFOUND
  npm ERR! errno ENOTFOUND
  npm ERR! network request to https://registry.npmjs.com/nodemon failed, reason: getaddrinfo ENOTFOUND 28
  npm ERR! network This is a problem related to network connectivity.
  npm ERR! network In most cases you are behind a proxy or have bad network settings.
  npm ERR! network
  npm ERR! network If you are behind a proxy, please make sure that the
  npm ERR! network 'proxy' config is set properly.  See: 'npm help config'`
  </code></pre>
  </blockquote>
  
  <p>I have check with proxy and it is set to below network.</p>
  
  <blockquote>
    <pre class="lang-none prettyprint-override"><code>Pinging proxy.internal.domainname.com with 32 bytes of data:
  Reply from &lt;ip address=""&gt;: bytes=32 time=2ms TTL=247
  Reply from &lt;ip address=""&gt;: bytes=32 time=2ms TTL=247
  Reply from &lt;ip address=""&gt;: bytes=32 time=2ms TTL=247
  Reply from &lt;ip address=""&gt;: bytes=32 time=2ms TTL=247
  Ping statistics for &lt;ip address=""&gt;:
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
  Approximate round trip times in milli-seconds:
  Minimum = 2ms, Maximum = 2ms, Average = 2ms
  </code></pre>
  </blockquote>
  
  <p>I tried to set proxy to <code>https://registry.npmjs.com/nodemon</code> using below command.</p>
  
  <pre class="lang-none prettyprint-override"><code>npm config set registry "http://registry.npmjs.org/ 
  </code></pre>
  
  <p>When I run npm install after this, again I got the same error. </p>
  
  <blockquote>
    <pre class="lang-none prettyprint-override"><code>npm --proxy http://registry.npmjs.org/  install npm
  npm ERR! code ENOTFOUND
  npm ERR! errno ENOTFOUND
  npm ERR! network request to http://registry.npmjs.org/npm failed, reason: getaddrinfo ENOTFOUND 28
  npm ERR! network This is a problem related to network connectivity.
  npm ERR! network In most cases you are behind a proxy or have bad network settings.
  npm ERR! network
  npm ERR! network If you are behind a proxy, please make sure that the
  npm ERR! network 'proxy' config is set properly.  See: 'npm help config'`
  </code></pre>
  </blockquote>
  
  <p>I have tried many other workarounds from google but still facing the same proxy issue.
  I am just looking to run this app in local so that I can test my code in local before deploying. Am I missing something here.</p>
  
  <p>Below is my sample package.json file.</p>
  
  <pre><code>{
    "name": "abc",
    "version": "0.0.1",
    "description": "abc",
    "main": "dist/index.js",
    "engines": {
      "node": "8.0.0",
      "npm": "5.0.0"
    },
    "scripts": {
      "prestart": "npm run -s build",
      "start": "node dist/index.js",
      "dev": "nodemon src/index.js --exec \"node -r dotenv/config -r babel-register\" localdev",
      "clean": "rimraf dist &amp;&amp; rimraf -p",
      "build": "npm run clean &amp;&amp; mkdir -p dist &amp;&amp; babel src -s -D -d dist",
      "test": "jest --watch",
      "lint": "esw -w src test"
    },
    "keywords": [
      "express",
      "babel",
      "es6",
      "es2015",
      "es2016",
      "es2017",
      "eslint"
    ],
    "author": "abc",
    "license": "LICENSED",
    "dependencies": {
      "babel-cli": "6.26.0",
      "babel-plugin-transform-object-rest-spread": "6.26.0",
      "babel-preset-env": "1.6.1",
      "cors": "2.8.5",
      "express": "4.16.4",
      "js-yaml": "3.12.2",
      "mssql": "5.0.0",
      "winston": "3.1.0",
      "winston-daily-rotate-file": "3.5.1"
    },
    "devDependencies": {
      "babel-eslint": "7.2.3",
      "babel-jest": "21.0.2",
      "babel-register": "6.24.1",
      "dotenv": "4.0.0",
      "eslint": "4.10.0",
      "eslint-config-airbnb-base": "12.1.0",
      "eslint-plugin-import": "2.8.0",
      "eslint-plugin-jest": "21.0.2",
      "eslint-watch": "3.1.0",
      "nodemon": "1.18.10",
      "rimraf": "2.6.3"
    },
    "babel": {
      "presets": [
        [
          "env",
          {
            "targets": {
              "node": "current"
            }
          }
        ]
      ],
      "plugins": [
        "transform-object-rest-spread"
      ]
    },
    "eslintConfig": {
      "parser": "babel-eslint",
      "plugins": [
        "import",
        "jest"
      ],
      "parserOptions": {
        "ecmaVersion": 2017,
        "sourceType": "module"
      },
      "env": {
        "node": true,
        "jest": true
      },
      "extends": [
        "eslint:recommended"
      ]
    }
  }
  </code></pre>
  
  <hr>
  
  <p><strong>Edit:</strong></p>
  
  <p>Running the <code>npm config ls</code> command returns the following result:</p>
  
  <blockquote>
    <pre class="lang-none prettyprint-override"><code>; cli configs
  metrics-registry = "http://registry.npmjs.org/async-each"
  scope = ""
  user-agent = "npm/6.13.4 node/v12.14.0 win32 x64"
  
  ; userconfig C:\Users\username\.npmrc
  https-proxy = "http://registry.npmjs.org/"
  https://registry.npmjs.com/nodemon = ""
  key = ""
  registry = "http://registry.npmjs.org/"
  strict-ssl = false
  
  ; builtin config undefined
  prefix = "C:\\Users\\username\\AppData\\Roaming\\npm"
  
  ; node bin location = C:\Program Files\nodejs\node.exe
  ; cwd = H:\IRB PMX Services\core\src
  ; HOME = C:\Users\username
  ; "npm config ls -l" to show all defaults.
  </code></pre>
  </blockquote>
  
  <hr>
  
  <p><strong>Edit 2:</strong></p>
  
  <p>I have now run the following command to delete the erroneous configuration key, i.e. the <code>https://registry.npmjs.com/nodemon = ""</code> part:</p>
  
  <pre class="lang-none prettyprint-override"><code>npm config delete https://registry.npmjs.com/nodemon
  </code></pre>
  
  <p>and again ran the <code>npm install</code> command. But again got the proxy error as below:</p>
  
  <blockquote>
    <pre class="lang-none prettyprint-override"><code>npm ERR! network request to registry.npmjs.org/async-each/@types%2fnode failed, reason: read ECONNRESET
  npm ERR! network This is a problem related to network connectivity.
  npm ERR! network In most cases you are behind a proxy or have bad network settings.
  npm ERR! network npm ERR! network If you are behind a proxy, please make sure that the
  ...
  </code></pre>
  </blockquote>