1

I am behind a corporate proxy, so my build can't download the node-sass-binaries directly from github. For now I have a Nexus3 raw repository (hosted). The biniary files are downloaded from https://github.com/sass/node-sass/releases/download/{version}/{artifact} and I upload them manually to the repository. In the .npmrc I reference my repository with node-sass-binary={path to repo} and it works fine. But I don't want to manually download and upload the files every time a new one is needed.

Now I want to set up a proxy repository that gets the artifacts automatically (like it is working with maven central).

What have I tried? I have created an Raw (proxy) repo and entered the download URL https://github.com/sass/node-sass/releases/download/

enter image description here

But this isn't working.

The error I get:

node-sass@4.11.0 install C:\Project\ng\src\node_modules\node-sass node scripts/install.js

Downloading binary from https://myserver/nexus/repository/node-sass-binary//v4.11.0/win32-x64-72_binding.node Cannot download "https://myserver/nexus/repository/node-sass-binary//v4.11.0/win32-x64-72_binding.node":

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location try setting a proxy via HTTP_PROXY, e.g.

 export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

 npm config set proxy http://example.com:8080

node-sass@4.11.0 postinstall C:\Project\ng\src\node_modules\node-sass node scripts/build.js

In my opinion this error message makes sense because if I call https://github.com/sass/node-sass/releases/download/ directly in the browser I get a 404 message.

So am I using the wrong URL or do I miss something else? Is it even possible to do this? Thanks for your help.

ochs.tobi
  • 3,214
  • 7
  • 31
  • 52
  • Did you try using npm (proxy) instead of raw (proxy) ? – Forest Nov 14 '19 at 06:07
  • 1
    I tried it, didn't work. Why this shoulde be an npm repository, the node-sass-binaries doesn't have an npm structure? – ochs.tobi Nov 14 '19 at 06:19
  • i have the same problem i think. i am proxying npm to get ibm_db but then ibm_db downloads a big gz file from ibm.com. ibm.com is https but my proxy is http. so i'm doing a raw proxy for that gz file... – JDPeckham Dec 20 '19 at 16:58

1 Answers1

1

I had a similar problem. I believe you are using Node v12 which is not supported with node-sass@4.11.0

https://github.com/sass/node-sass/releases/tag/v4.11.0

and for this reason win32-x64-72_binding.node is not found (72 refers to Node v.12 ...) So, use node-sass 4.12.0 or higher in order to fix this issue.

Luca Teti
  • 33
  • 4
  • That doesn't answer the question. node-sass repository can't be proxied for automatic donwloading behind a corporate proxy. – ochs.tobi Jul 23 '20 at 05:02
  • i was able to configure the proxy using Nexus3 with the same configuration you used (with only one differeence i.e. checking the flag "use the Nexus TrustStore") and i'm behing a HTTP proxy. The error you have is instead due to wrong version of node-sass library because no version_72 exists for node-sass@4.11.0 .... – Luca Teti Jul 24 '20 at 06:21
  • Okay, I will try this. Although I don't really need it anymore because Angular switched from node-sass to dart-sass. Thanks for your help – ochs.tobi Jul 24 '20 at 06:44