4

I am using npm 6

❯ npm -v
6.14.11

and the registry is set to

❯ npm config get registry
https://registry.npmjs.org/
❯ cat  ~/.npmrc
registry=https://registry.npmjs.org/

removing the package-lock.json(should not be needed) file and running npm install generates some values that load from yarnpkg registry

example

"deep-is": {
      "version": "0.1.3",
      "resolved": "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz",
      "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
      "dev": true
    },

why is that? and why is my registry preference not respected?

Jakob Cosoroaba
  • 1,702
  • 4
  • 24
  • 34
  • 1
    is it possible they're cached? Have you tried `npm cache clear --force` and then see what happens? – Joe Feb 24 '21 at 17:43
  • nuking everything: cache, node_modules, package-lock.json did produce a new valid package-lock.json containing only npmjs.org resolves, but so many changes to the package-lock file that reviewing the dependencies is hard that solved my problem, @joe – Jakob Cosoroaba Feb 26 '21 at 07:31
  • You ask "why" but the accepted answer is answering with a fix - which would be a duplicate of https://stackoverflow.com/q/62439074/4722345 – JBallin Oct 20 '22 at 05:06

2 Answers2

2

I am running npm -v 6.14.15

Perhaps you didn't remove the node_modules folder before doing an install? Apparently the registry value from node_modules will override anything from the package-lock.json.

You should change the registry values inside of the package-lock.json, delete node_modules folder, and then do an npm i.

1

npm install respects the package-lock. It won't update it unless you're adding/updating a package (which you've done in the past after configuring the new registry, resulting in some entries with the new registry).

If you're interested in updating your package-lock to use the new registry for all deps, see this question.

JBallin
  • 8,481
  • 4
  • 46
  • 51