title: Override registry for installed packages in package-lock.json
body: <p>I have a large, existing <code>package-lock.json</code> and a lot of dependencies that have been resolved via <a href="http://registry.npmjs.org/" rel="noreferrer">http://registry.npmjs.org/</a>.</p>
  
  <p>e.g.</p>
  
  <pre><code>{
    "name": "my-package",
    "version": "1.2.3",
    "lockfileVersion": 1,
    "requires": true,
    "dependencies": {
      "@babel/cli": {
        "version": "7.7.4",
        "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.7.4.tgz",
        "integrity": "sha512-O7mmzaWdm+VabWQmxuM8hqNrWGGihN83KfhPUzp2lAW4kzIMwBxujXkZbD4fMwKMYY9FXTbDvXsJqU+5XHXi4A==",
        "dev": true,
        "requires": {
          "chokidar": "^2.1.8",
          "commander": "^4.0.1",
          "convert-source-map": "^1.1.0",
          "fs-readdir-recursive": "^1.1.0",
          "glob": "^7.0.0",
          "lodash": "^4.17.13",
          "make-dir": "^2.1.0",
          "slash": "^2.0.0",
          "source-map": "^0.5.0"
        },
        "dependencies": {
          "commander": {
            "version": "4.0.1",
            "resolved": "https://registry.npmjs.org/commander/-/commander-4.0.1.tgz",
            "integrity": "sha512-IPF4ouhCP+qdlcmCedhxX4xiGBPyigb8v5NeUp+0LyhwLgxMqyp3S0vl7TAPfS/hiP7FC3caI/PB9lTmP8r1NA==",
            "dev": true
          },
          "make-dir": {
            "version": "2.1.0",
            "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
            "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
            "dev": true,
            "requires": {
              "pify": "^4.0.1",
              "semver": "^5.6.0"
            }
          },
          "pify": {
            "version": "4.0.1",
            "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
            "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
            "dev": true
          },
          "source-map": {
            "version": "0.5.7",
            "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
            "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
            "dev": true
          }
        }
      },
      ...
  
  </code></pre>
  
  <p>I have my registry configured to be an NPM Enterprise installation that hosts proprietary NPM packages and mirrors the public NPM registry.</p>
  
  <pre><code>registry = "https://custom.registry.tld/path/npm/npm-aggregate"
  </code></pre>
  
  <p>This works for newly installed packages, but many existing packages still point to the public NPM registry. I tried overwriting the package-lock.json using <code>npm i</code> or <code>npm i --package-lock-only</code>.</p>
  
  <p>How can I force NPM to use my Enterprise NPM registry and write the correct <code>resolved</code> URLs to <code>package-lock.json</code>? I probably could just "find and replace", but I want to make sure that NPM is resolving dependencies correctly.</p>