Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install changed the package-lock resolved for some packages from registry.npmjs.org to registry.yarnpkg.com

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?

like image 869
Jakob Cosoroaba Avatar asked Oct 20 '25 13:10

Jakob Cosoroaba


2 Answers

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.

like image 106
Khalah Jones - Golden Avatar answered Oct 22 '25 03:10

Khalah Jones - Golden


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.

like image 28
JBallin Avatar answered Oct 22 '25 04:10

JBallin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!