HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Issue installing NPM packages on Jenkins

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
jenkinsissuenpminstallingpackages

Problem

I have a Jenkins build I am using for a Vue.js application. I am trying to install all dependancies as part of the pipeline and am running into some issues. I've included the below output as well as the npm install part of my pipeline.

It looks like a python issue to me however I don't think I'm using python unless vue uses it under the hood

error from below build step

```
+ npm install
> node-sass@4.12.0 install /var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.12.0/linux-x64-79_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.12.0/linux-x64-79_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.12.0 postinstall /var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass
> node scripts/build.js

Building: /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/UI/bin/node /var/lib/jenkins/workspace/Deploy UI/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli '/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/UI/bin/node',
gyp verb cli '/var/lib/jenkins/workspace/Deploy UI/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library='
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@13.1.0 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command

Solution

There are likely a multitude of issues that could be the root cause, as a starter for ten I would look at the following:

-
Is the ownership and permissions on the node_modules directory correct, i.e. does your Jenkins user have the permission to write to all of the files and directories in the folder. This is a common problem if you have multiple users involved in the build process - less common on a dedicated build server.

-
Do you have all of the dependencies for building the packages, for example:

  • you have a dependency on "node-sass": "^4.12.0"



  • which has a dependency on node-gyp



  • which has dependencies on Python, make and a C/C++ toolchain like gcc



There is a much longer troubleshooting guide on the node-sass GitHub which may be of help, although you may well find that even if you get node-sass to work you will ened up with another package failing because of missing dependencies.

Context

StackExchange DevOps Q#9762, answer score: 1

Revisions (0)

No revisions yet.