Search code examples
angulargitlab-cinode-sass

gitlab ci throwing error for angular project


I have recently started getting error for my CI in gitlab-ci for my angular project

The error is as follows

$ npm install --unsafe-perm -g --save-dev @angular/cli@1.3.2
/usr/local/bin/ng -> /usr/local/lib/node_modules/@angular/cli/bin/ng

> node-sass@4.5.3 install /usr/local/lib/node_modules/@angular/cli/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.3/linux_musl-x64-59_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.3/linux_musl-x64-59_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

I know that the file https://github.com/sass/node-sass/releases/download/v4.5.3/linux_musl-x64-59_binding.nodedoesn't exist, but I am not sure why node-sass is trying to install that version of the file?


Solution

  • The issue was with the node versioning. In my gitlab-ci I was using the latest node docker image (node:alpine) and node:alpine tag has been moved to node version 9.x.x as of 31st October 2017. Hence, this broke node-sass as node-sass only supports upto 8.X.X as of version 4.5.3

    I switched my node docker image to node:carbon-alpine which supports node 8.X.X and that fixed the problem.