andthereitgoes
andthereitgoes

Reputation: 889

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/[email protected]
/usr/local/bin/ng -> /usr/local/lib/node_modules/@angular/cli/bin/ng

> [email protected] 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?

Upvotes: 0

Views: 802

Answers (2)

andthereitgoes
andthereitgoes

Reputation: 889

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.

Upvotes: 1

Vivek Doshi
Vivek Doshi

Reputation: 58533

First clear npm cache :

npm cache clean  

Then install node-sass globally :

npm install -g [email protected]

Then run your command :

npm install --unsafe-perm -g --save-dev @angular/[email protected]

If it still not works , then try to install it with yarn :

yarn add node-sass

And then run your command

Upvotes: 0

Related Questions