Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yarn lock file resource source changed from registry.yarnpkg.com to registry.npmjs.org

Tags:

npm

yarnpkg

I recently npm installed a package into my Ruby on Rails application. The installation changed my yarn.lock file. Specifically, the "resolved" field for all my resources have changed from yarnpkg.com to npmjs.org.

From this:

d3-dsv@1:
  version "..."
  resolved "https://registry.yarnpkg.com/d3-dsv/-/d3-dsv-1.0.8.tgz#..."
  integrity ...

To this:

"d3-dsv@1":
  "integrity" "..."
  "resolved" "https://registry.npmjs.org/d3-dsv/-/d3-dsv-1.1.1.tgz"
  "version" "..."

Is there a problem with these changes in this yark.lock file? Should I have done some yarn alternate to npm installing?

like image 693
Peabrain Avatar asked Dec 08 '25 17:12

Peabrain


2 Answers

It might be something related to where are you getting the packages from.

You can find out by typing: -> yarn config get registry

sometimes the registry is npmjs.org and that could be the reason why is getting changed in the yarn.lock.

So, you could set the registry to -> https://registry.yarnpkg.com by typing:

yarn config set registry https://registry.yarnpkg.com

then delete the yarn.lock file and retry again running yarn.

like image 51
Diego Lopez Sarmiento Avatar answered Dec 11 '25 19:12

Diego Lopez Sarmiento


You can fix this issue by re-running yarn again.


To accomplish this, follow the steps below.

  1. Remove the registry.npmjs.org section in your yarn.lock file.

  2. Run the yarn command again.

    $ yarn
    

    This should rewrite the yarn.lock to change the registry from npm to Yarn.


The steps above should rewrite the yarn.lock file, and change the registry and text from npm to Yarn.

like image 23
Viradex Avatar answered Dec 11 '25 21:12

Viradex



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!