yarn install is not using most recent version

80 views Asked by At

I am working with a selfwritten React component my-ui library which is hosted on my own GitLab instance. In my package.json I am including the custom component library my-ui like this

"my-ui": "git+ssh://[email protected]:.../my-ui.git#main"

Now, when I push changes to main in my-ui and I do a yarn install in the project where I am using my-ui the changes are not reflected. I sometimes have to wait a few days that a yarn install actually installs the changes...

I assume this is because yarn (or something else?) is caching something?

I tried rm -rf the node_modules folder, yarn cache clean and yarn install --force but this does not do the trick. How would I install always the latest version of my-ui?

1

There are 1 answers

0
four-eyes On BEST ANSWER

I think the reason for this lays in the yarn.lock file.

"my-ui@git+ssh://[email protected]#main":
  version "1.0.0"
  resolved "git+ssh://git@git....:development/my-ui.git#14f7fcc2199dd2aa261b738c32dacc721c78f0d2"

If i remove this line and run a yarn install again, it pulls the most recent version. I guess this 14f7fcc2199dd2aa261b738c32dacc721c78f0d2 is referencing the previous installed version.