I'm trying to proxy node-sass and other npm libraries through Nexus, but run into problems when a post install step of node-sass tries to pull the file https://github.com/sass/node-sass/releases/download/v3.10.1/linux-x64-48_binding.node from github. I'm behind a corporate firewall, so my only option is having Nexus proxy all the files I need.
Is it possible to add just this individual file to Nexus somehow, so that it's able to proxy that and deliver it whenever a request is sent to https://github.com/sass/node-sass/releases/download/v3.10.1/linux-x64-48_binding.node?
A proxy repository is a substitute access point and managed cache for remote repositories. These could be the public repositories for open source components or private repositories such as another Nexus Repository for instance.
Nexus Repository Manager provides for three different kinds of repositories: Proxy repositories, Hosted repositories and Virtual repositories.
A raw proxy repository can be used to proxy any static website. This includes a Maven site hosted in a raw repository in another Nexus Repository Manager server or a plain static website hosted on another web server like Apache httpd.
Repository groups are a powerful feature of Nexus Repository Manager. They allow you to combine multiple repositories and other repository groups of the same repository format in a single repository group.
After some digging the best solution I can think of is to do this:
https://github.com/sass/node-sass/blob/9c6933f4eb5c9572e1cdc577d500469c14411908/lib/extensions.js#L121-L147
You can use the --sass-binary-site argument or environment variable (or value in your .npmrc, lol) to override where it will reach out for these packages, where you could potentially clone the repo internally so that you have them all: https://github.com/sass/node-sass-binaries
More info on this is available on these two issues:
As well, there is a lot of information on this available here (towards the bottom) from us friendly folks at Sonatype: https://support.sonatype.com/hc/en-us/articles/213465048-Why-does-npm-client-need-access-to-URLs-other-than-my-private-registry-
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With