2

So in my package.json I have a bunch of npm libs, and one private repo being pulled in from a git ssh url which needs to always be the latest build. The yarn.lock adds the git sha and yarn upgrade etc won't grab the newest one.

Basically, given this:

"dependencies": {
  "some-package"        : "^0.x.x",
  "some-other-package"  : "*",
  "my-private-git-repo" : "git+ssh://git@bitbucket.org/me/myrepo.git",
  "lastlibrary"         : "^4.0.3"
},

I want yarn.lock or npm shrinkwrap to ignore my-private-git-repo

Is this possible?

Aurora0001
  • 13,139
  • 5
  • 50
  • 53
AlienWebguy
  • 76,997
  • 17
  • 122
  • 145

1 Answers1

2

Well I managed to pull this off by using Perl to remove the cache entry from the file itself.

Given my package.json has this :

"postinstall": "bash ./scripts/after_install.sh",

My after_install.sh now has this :

perl -0777 -i -pe 's/(?s)"myrepo.*?\n\n//s' ./yarn.lock

AlienWebguy
  • 76,997
  • 17
  • 122
  • 145