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

<ol>
<li><p>Is the ownership and permissions on the <code>node_modules</code> 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.</p></li>
<li><p>Do you have all of the dependencies for building the packages, for example:</p>

<ul>
<li>you have a dependency on <code>"node-sass": "^4.12.0"</code>

<ul>
<li>which has a dependency on <a href="https://github.com/nodejs/node-gyp" rel="nofollow noreferrer">node-gyp</a>

<ul>
<li>which has dependencies on Python, <code>make</code> and a C/C++ toolchain like <code>gcc</code></li>
</ul></li>
</ul></li>
</ul></li>
</ol>

<p>There is a much longer troubleshooting guide on the <a href="https://github.com/sass/node-sass/blob/master/TROUBLESHOOTING.md#linuxosx" rel="nofollow noreferrer">node-sass GitHub</a> 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.</p>

CC BY-SA 4.0
2019-11-12T10:07:51.133Z
2019-11-12T10:07:51.133Z
Richard Slater
<p>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. </p>

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

<p>error from below build step</p>

<pre><code>+ npm install
&gt; node-sass@4.12.0 install /var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass
&gt; 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

&gt; node-sass@4.12.0 postinstall /var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass
&gt; 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 configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:89:16
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:89:16
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21) {
gyp verb `which` failed   stack: 'Error: not found: python2\n' +
gyp verb `which` failed     '    at getNotFoundError (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:13:12)\n' +
gyp verb `which` failed     '    at F (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:68:19)\n' +
gyp verb `which` failed     '    at E (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:80:29)\n' +
gyp verb `which` failed     '    at /var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:89:16\n' +
gyp verb `which` failed     '    at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/index.js:42:5\n' +
gyp verb `which` failed     '    at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/mode.js:8:5\n' +
gyp verb `which` failed     '    at FSReqCallback.oncomplete (fs.js:158:21)',
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:89:16
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb `which` failed  python Error: not found: python
gyp verb `which` failed     at getNotFoundError (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:89:16
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21) {
gyp verb `which` failed   stack: 'Error: not found: python\n' +
gyp verb `which` failed     '    at getNotFoundError (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:13:12)\n' +
gyp verb `which` failed     '    at F (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:68:19)\n' +
gyp verb `which` failed     '    at E (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:80:29)\n' +
gyp verb `which` failed     '    at /var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:89:16\n' +
gyp verb `which` failed     '    at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/index.js:42:5\n' +
gyp verb `which` failed     '    at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/mode.js:8:5\n' +
gyp verb `which` failed     '    at FSReqCallback.oncomplete (fs.js:158:21)',
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/var/lib/jenkins/workspace/Deploy UI/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack     at PythonFinder.&lt;anonymous&gt; (/var/lib/jenkins/workspace/Deploy UI/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack     at F (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:80:29)
gyp ERR! stack     at /var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:89:16
gyp ERR! stack     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:158:21)
gyp ERR! System Linux 4.15.0-1052-aws
gyp ERR! command "/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 ERR! cwd /var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass
gyp ERR! node -v v13.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.12.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@4.12.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /var/lib/jenkins/workspace/Deploy UI/.npm/_logs/2019-11-12T02_15_01_035Z-debug.log
</code></pre>

<p>package.json</p>

<pre><code>"dependencies": {
    "@agametov/vueditor": "^0.4.1",
    "@chenfengyuan/vue-countdown": "^1.1.2",
    "apexcharts": "^3.8.3",
    "axios": "^0.19.0",
    "bootstrap": "^4.3.1",
    "bootstrap-social": "^5.1.1",
    "bootstrap-vue": "^2.0.0-rc.27",
    "chart.js": "^2.8.0",
    "flag-icon-css": "^3.3.0",
    "ionicons": "^4.6.2",
    "moment": "^2.24.0",
    "node-sass": "^4.12.0",
    "sass-loader": "^7.1.0",
    "simple-line-icons": "^2.4.1",
    "v-autocomplete": "^1.8.2",
    "vue": "^2.6.10",
    "vue-apexcharts": "^1.4.0",
    "vue-bootstrap-datetimepicker": "^5.0.1",
    "vue-chartjs": "^3.4.2",
    "vue-custom-scrollbar": "^1.1.0",
    "vue-event-calendar": "^1.5.2",
    "vue-full-calendar": "^2.7.0",
    "vue-good-table": "^2.17.4",
    "vue-hljs": "^1.1.2",
    "vue-input-tag": "^2.0.6",
    "vue-ins-progress-bar": "^1.0.0",
    "vue-maskedinput": "^0.1.3",
    "vue-moment": "^4.0.0",
    "vue-notification": "^1.3.16",
    "vue-nvd3": "^1.0.0",
    "vue-pop-colorpicker": "^1.0.2",
    "vue-router": "^3.0.7",
    "vue-select": "^3.1.0",
    "vue-slider-component": "^3.0.33",
    "vue-sparklines": "^0.1.9",
    "vue-stripe-elements-plus": "^0.3.2",
    "vue-sweetalert2": "^2.1.1",
    "vue2-google-maps": "^0.10.7",
    "vuejs-datepicker": "^1.6.2"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^3.9.2",
    "@vue/cli-plugin-eslint": "^3.9.2",
    "@vue/cli-service": "^3.9.3",
    "vue-template-compiler": "^2.6.10"
  },
</code></pre>

<p>my pipeline code</p>

<pre><code>stage('Build') {
        steps {
            nodejs(nodeJSInstallationName: 'UI') {
               sh "npm install &amp;&amp; npm install --only=dev &amp;&amp; npm run build --${params.buildenv}"
            }
        }
    }
</code></pre>

<p>EDIT **
installed python via the apt repo and ran into a bigger (longer) error message. I can't include here as too long (tried already) </p>

<p>A bunch of lines about node openssl like the below </p>

<p><code>gyp verb extracted file from tarball include/node/openssl/aes.h</code></p>

<pre><code>gyp verb tarball done parsing tarball
gyp verb check download content checksum, need to download `SHASUMS256.txt`... 
gyp verb checksum url https://nodejs.org/download/release/v13.1.0/SHASUMS256.txt
gyp http GET https://nodejs.org/download/release/v13.1.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v13.1.0/SHASUMS256.txt
gyp verb checksum data {"node-v13.1.0-aix-ppc64.tar.gz":"5faec026afe9052f277402500236dd9ec4d58e0e8de93f66989fc337c65e33c8","node-v13.1.0-darwin-x64.tar.gz":"6501c1bcf2babb5b9c81dcff8b52021f726da8f6ee28df1637acade1a16c7d39","node-v13.1.0-darwin-x64.tar.xz":"b918bdc6ca5726084a737c926744cdaecde624ba39ac8aaed889f296007a5094","node-v13.1.0-headers.tar.gz":"577785216f5a4097a9108fd05f3117556f0954f0a03a26cfbfd1ce7af94587d4","node-v13.1.0-headers.tar.xz":"73ec6759903137d3e22806e745777cb7cda3150f0d81c5ba13e7599c2be03d32","node-v13.1.0-linux-arm64.tar.gz":"dd36c7846f7713b6e55baf0b6ab7882c18b129d83a3d0f7ef62790d181461d22","node-v13.1.0-linux-arm64.tar.xz":"646d597e6b0dc400429e46b703a5135c77bd71e653ea4c8254d0b60c17b6ec1d","node-v13.1.0-linux-armv7l.tar.gz":"88450bc38dac0be15c9bd09bfccf4ce79f1911930f37658c730c151b26c5aa97","node-v13.1.0-linux-armv7l.tar.xz":"e15601106fbd9ed75a4642eab91bb3f3ddab8b5821e886bdb070c014d9ab9af2","node-v13.1.0-linux-ppc64le.tar.gz":"0c804f0671bcdada9be66e4ca844c08f897357fbf2426be8cc326d20e6362833","node-v13.1.0-linux-ppc64le.tar.xz":"561dbaa36db7dcb4fff378e110b4ddd29d918754e73449208899fbfb9f3ce1ae","node-v13.1.0-linux-s390x.tar.gz":"24c29e917230d9cc510ba764ff6ef57bcc816520c146b47dce3ed4aeb3f7d333","node-v13.1.0-linux-s390x.tar.xz":"a3229a795ee8bda15396701badd31d695d9a6f487a730c73022305c98522767a","node-v13.1.0-linux-x64.tar.gz":"490e998198e152450e79bb65178813ce0c81708954697f91cfd82537acfcb588","node-v13.1.0-linux-x64.tar.xz":"2eecb5a4b7975c3b406bee36b12c9a29e8bedf9553c88cad310b8f076db00881","node-v13.1.0.pkg":"3b6abd2a5f7a5778bbe5363ea222910b19674648eb2b3d734d9ee751ec29da71","node-v13.1.0-sunos-x64.tar.gz":"8e17a613950018e27f34f7268e01cbb385777189961ccf386f7d0d05883687b3","node-v13.1.0-sunos-x64.tar.xz":"e9dd61b7f537b98a6656c0e03766997aa712bf3d40e7cb08ba4019e942846739","node-v13.1.0.tar.gz":"df640a2f151f788d02dc25c91d80fffe06b4c3c72fbdee07ab9abd7c6879d6cd","node-v13.1.0.tar.xz":"d42c056cbd33b35836b0f5cfb2c56712b965ea76e188ef79af492614cf14cb68","node-v13.1.0-win-x64.7z":"8f242259fa929f759f06bb1cf399df3b81061eb1ce5ccaa9d206dc157fcf93fc","node-v13.1.0-win-x64.zip":"d735e97bdeb7b74551b9d165c708a3fdea4dbb3801a65e70f6d6ae3539d48a03","node-v13.1.0-win-x86.7z":"c4ecf16dd147956c9335b547fdfb1b0eb1c333c1a1722843b45ba04b9fee17fe","node-v13.1.0-win-x86.zip":"81af54ba9e852073ac975aa0955da1efb4b2ea6ef213eb3ce90f3b22a82555d8","node-v13.1.0-x64.msi":"22ec0be47b0f3f5f163f82e18c01df456921f39b756ee4a828534264b06d0fe6","node-v13.1.0-x86.msi":"7f56fa7350eaf0da6d33b24578a281e8d759a9344e5c8ea851ea541eaebb94fe","win-x64/node.exe":"5c3b0006330a08743363ebf26ccdf1618ab0269f50756088b6e5257d7a32c5a1","win-x64/node.lib":"aa183bbe6f7a2b63395ff83ac6f687274bafbc1e64be2e6e5bb600dc1e5c7bea","win-x64/node_pdb.7z":"7e4bc02444eea52b90d15d1985789aa10efa5b058a6550aac389db3eba42a4b7","win-x64/node_pdb.zip":"ae389590498393e57379d462b3d8d6c2639afcf04d6c279f99b8e2122b98b94e","win-x86/node.exe":"20fb3aa33b88628c533e59fec344db02683434cfbd91d70a36e3a0c3f865ed03","win-x86/node.lib":"caa896eb2249fdf32ed3dda1c7bdb8250b8dbdf6f5498b10a4dec91f541d2d11","win-x86/node_pdb.7z":"e2301d3ae38b01fecceb8111955568a741183de87d05c88a6499abfca1e913b1","win-x86/node_pdb.zip":"5d9cc82ef9f2165f08ad4057b23c90154bf6a334ed7f9d3b5757003f70f49108"}
gyp verb download contents checksum {"node-v13.1.0-headers.tar.gz":"577785216f5a4097a9108fd05f3117556f0954f0a03a26cfbfd1ce7af94587d4"}
gyp verb validating download checksum for node-v13.1.0-headers.tar.gz (577785216f5a4097a9108fd05f3117556f0954f0a03a26cfbfd1ce7af94587d4 == 577785216f5a4097a9108fd05f3117556f0954f0a03a26cfbfd1ce7af94587d4)
gyp verb get node dir target node version installed: 13.1.0
gyp verb build dir attempting to create "build" dir: /var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass/build
gyp verb build dir "build" dir needed to be created? /var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass/build/config.gypi
gyp verb config.gypi checking for gypi file: /var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass/config.gypi
gyp verb common.gypi checking for gypi file: /var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /usr/bin/python2
gyp info spawn args [
gyp info spawn args   '/var/lib/jenkins/workspace/Deploy UI/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/var/lib/jenkins/workspace/Deploy UI/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0',
gyp info spawn args   '-Dnode_gyp_dir=/var/lib/jenkins/workspace/Deploy UI/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0/&lt;(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir /var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass/build'
  g++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.4"' -I/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0/include/node -I/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0/src -I/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0/deps/openssl/config -I/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0/deps/openssl/openssl/include -I/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0/deps/uv/include -I/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0/deps/zlib -I/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++1y -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/ast.o ../src/libsass/src/ast.cpp
g++: error: UI/.node-gyp/13.1.0/include/node: No such file or directory
g++: error: UI/.node-gyp/13.1.0/src: No such file or directory
g++: error: UI/.node-gyp/13.1.0/deps/openssl/config: No such file or directory
g++: error: UI/.node-gyp/13.1.0/deps/openssl/openssl/include: No such file or directory
g++: error: UI/.node-gyp/13.1.0/deps/uv/include: No such file or directory
g++: error: UI/.node-gyp/13.1.0/deps/zlib: No such file or directory
g++: error: UI/.node-gyp/13.1.0/deps/v8/include: No such file or directory
src/libsass.target.mk:158: recipe for target 'Release/obj.target/libsass/src/libsass/src/ast.o' failed
make: *** [Release/obj.target/libsass/src/libsass/src/ast.o] Error 1
make: Leaving directory '/var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/var/lib/jenkins/workspace/Deploy UI/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.15.0-1052-aws
gyp ERR! command "/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 ERR! cwd /var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass
gyp ERR! node -v v13.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.12.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@4.12.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above
</code></pre>

<jenkins><npm>
Issue installing NPM packages on Jenkins
joshk132
# Issue installing NPM packages on Jenkins

(Asked by: username_0 on 2019-11-12)

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 configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:89:16
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:89:16
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21) {
gyp verb `which` failed   stack: 'Error: not found: python2\n' +
gyp verb `which` failed     '    at getNotFoundError (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:13:12)\n' +
gyp verb `which` failed     '    at F (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:68:19)\n' +
gyp verb `which` failed     '    at E (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:80:29)\n' +
gyp verb `which` failed     '    at /var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:89:16\n' +
gyp verb `which` failed     '    at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/index.js:42:5\n' +
gyp verb `which` failed     '    at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/mode.js:8:5\n' +
gyp verb `which` failed     '    at FSReqCallback.oncomplete (fs.js:158:21)',
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:89:16
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb `which` failed  python Error: not found: python
gyp verb `which` failed     at getNotFoundError (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:89:16
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21) {
gyp verb `which` failed   stack: 'Error: not found: python\n' +
gyp verb `which` failed     '    at getNotFoundError (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:13:12)\n' +
gyp verb `which` failed     '    at F (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:68:19)\n' +
gyp verb `which` failed     '    at E (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:80:29)\n' +
gyp verb `which` failed     '    at /var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:89:16\n' +
gyp verb `which` failed     '    at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/index.js:42:5\n' +
gyp verb `which` failed     '    at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/mode.js:8:5\n' +
gyp verb `which` failed     '    at FSReqCallback.oncomplete (fs.js:158:21)',
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/var/lib/jenkins/workspace/Deploy UI/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack     at PythonFinder. (/var/lib/jenkins/workspace/Deploy UI/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack     at F (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:80:29)
gyp ERR! stack     at /var/lib/jenkins/workspace/Deploy UI/node_modules/which/which.js:89:16
gyp ERR! stack     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /var/lib/jenkins/workspace/Deploy UI/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:158:21)
gyp ERR! System Linux 4.15.0-1052-aws
gyp ERR! command "/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 ERR! cwd /var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass
gyp ERR! node -v v13.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.12.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@4.12.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /var/lib/jenkins/workspace/Deploy UI/.npm/_logs/2019-11-12T02_15_01_035Z-debug.log

package.json
"dependencies": {
    "@agametov/vueditor": "^0.4.1",
    "@chenfengyuan/vue-countdown": "^1.1.2",
    "apexcharts": "^3.8.3",
    "axios": "^0.19.0",
    "bootstrap": "^4.3.1",
    "bootstrap-social": "^5.1.1",
    "bootstrap-vue": "^2.0.0-rc.27",
    "chart.js": "^2.8.0",
    "flag-icon-css": "^3.3.0",
    "ionicons": "^4.6.2",
    "moment": "^2.24.0",
    "node-sass": "^4.12.0",
    "sass-loader": "^7.1.0",
    "simple-line-icons": "^2.4.1",
    "v-autocomplete": "^1.8.2",
    "vue": "^2.6.10",
    "vue-apexcharts": "^1.4.0",
    "vue-bootstrap-datetimepicker": "^5.0.1",
    "vue-chartjs": "^3.4.2",
    "vue-custom-scrollbar": "^1.1.0",
    "vue-event-calendar": "^1.5.2",
    "vue-full-calendar": "^2.7.0",
    "vue-good-table": "^2.17.4",
    "vue-hljs": "^1.1.2",
    "vue-input-tag": "^2.0.6",
    "vue-ins-progress-bar": "^1.0.0",
    "vue-maskedinput": "^0.1.3",
    "vue-moment": "^4.0.0",
    "vue-notification": "^1.3.16",
    "vue-nvd3": "^1.0.0",
    "vue-pop-colorpicker": "^1.0.2",
    "vue-router": "^3.0.7",
    "vue-select": "^3.1.0",
    "vue-slider-component": "^3.0.33",
    "vue-sparklines": "^0.1.9",
    "vue-stripe-elements-plus": "^0.3.2",
    "vue-sweetalert2": "^2.1.1",
    "vue2-google-maps": "^0.10.7",
    "vuejs-datepicker": "^1.6.2"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^3.9.2",
    "@vue/cli-plugin-eslint": "^3.9.2",
    "@vue/cli-service": "^3.9.3",
    "vue-template-compiler": "^2.6.10"
  },

my pipeline code
stage('Build') {
        steps {
            nodejs(nodeJSInstallationName: 'UI') {
               sh "npm install && npm install --only=dev && npm run build --${params.buildenv}"
            }
        }
    }

EDIT **
installed python via the apt repo and ran into a bigger (longer) error message. I can't include here as too long (tried already) 
A bunch of lines about node openssl like the below 
gyp verb extracted file from tarball include/node/openssl/aes.h
gyp verb tarball done parsing tarball
gyp verb check download content checksum, need to download `SHASUMS256.txt`... 
gyp verb checksum url https://nodejs.org/download/release/v13.1.0/SHASUMS256.txt
gyp http GET https://nodejs.org/download/release/v13.1.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v13.1.0/SHASUMS256.txt
gyp verb checksum data {"node-v13.1.0-aix-ppc64.tar.gz":"5faec026afe9052f277402500236dd9ec4d58e0e8de93f66989fc337c65e33c8","node-v13.1.0-darwin-x64.tar.gz":"6501c1bcf2babb5b9c81dcff8b52021f726da8f6ee28df1637acade1a16c7d39","node-v13.1.0-darwin-x64.tar.xz":"b918bdc6ca5726084a737c926744cdaecde624ba39ac8aaed889f296007a5094","node-v13.1.0-headers.tar.gz":"577785216f5a4097a9108fd05f3117556f0954f0a03a26cfbfd1ce7af94587d4","node-v13.1.0-headers.tar.xz":"73ec6759903137d3e22806e745777cb7cda3150f0d81c5ba13e7599c2be03d32","node-v13.1.0-linux-arm64.tar.gz":"dd36c7846f7713b6e55baf0b6ab7882c18b129d83a3d0f7ef62790d181461d22","node-v13.1.0-linux-arm64.tar.xz":"646d597e6b0dc400429e46b703a5135c77bd71e653ea4c8254d0b60c17b6ec1d","node-v13.1.0-linux-armv7l.tar.gz":"88450bc38dac0be15c9bd09bfccf4ce79f1911930f37658c730c151b26c5aa97","node-v13.1.0-linux-armv7l.tar.xz":"e15601106fbd9ed75a4642eab91bb3f3ddab8b5821e886bdb070c014d9ab9af2","node-v13.1.0-linux-ppc64le.tar.gz":"0c804f0671bcdada9be66e4ca844c08f897357fbf2426be8cc326d20e6362833","node-v13.1.0-linux-ppc64le.tar.xz":"561dbaa36db7dcb4fff378e110b4ddd29d918754e73449208899fbfb9f3ce1ae","node-v13.1.0-linux-s390x.tar.gz":"24c29e917230d9cc510ba764ff6ef57bcc816520c146b47dce3ed4aeb3f7d333","node-v13.1.0-linux-s390x.tar.xz":"a3229a795ee8bda15396701badd31d695d9a6f487a730c73022305c98522767a","node-v13.1.0-linux-x64.tar.gz":"490e998198e152450e79bb65178813ce0c81708954697f91cfd82537acfcb588","node-v13.1.0-linux-x64.tar.xz":"2eecb5a4b7975c3b406bee36b12c9a29e8bedf9553c88cad310b8f076db00881","node-v13.1.0.pkg":"3b6abd2a5f7a5778bbe5363ea222910b19674648eb2b3d734d9ee751ec29da71","node-v13.1.0-sunos-x64.tar.gz":"8e17a613950018e27f34f7268e01cbb385777189961ccf386f7d0d05883687b3","node-v13.1.0-sunos-x64.tar.xz":"e9dd61b7f537b98a6656c0e03766997aa712bf3d40e7cb08ba4019e942846739","node-v13.1.0.tar.gz":"df640a2f151f788d02dc25c91d80fffe06b4c3c72fbdee07ab9abd7c6879d6cd","node-v13.1.0.tar.xz":"d42c056cbd33b35836b0f5cfb2c56712b965ea76e188ef79af492614cf14cb68","node-v13.1.0-win-x64.7z":"8f242259fa929f759f06bb1cf399df3b81061eb1ce5ccaa9d206dc157fcf93fc","node-v13.1.0-win-x64.zip":"d735e97bdeb7b74551b9d165c708a3fdea4dbb3801a65e70f6d6ae3539d48a03","node-v13.1.0-win-x86.7z":"c4ecf16dd147956c9335b547fdfb1b0eb1c333c1a1722843b45ba04b9fee17fe","node-v13.1.0-win-x86.zip":"81af54ba9e852073ac975aa0955da1efb4b2ea6ef213eb3ce90f3b22a82555d8","node-v13.1.0-x64.msi":"22ec0be47b0f3f5f163f82e18c01df456921f39b756ee4a828534264b06d0fe6","node-v13.1.0-x86.msi":"7f56fa7350eaf0da6d33b24578a281e8d759a9344e5c8ea851ea541eaebb94fe","win-x64/node.exe":"5c3b0006330a08743363ebf26ccdf1618ab0269f50756088b6e5257d7a32c5a1","win-x64/node.lib":"aa183bbe6f7a2b63395ff83ac6f687274bafbc1e64be2e6e5bb600dc1e5c7bea","win-x64/node_pdb.7z":"7e4bc02444eea52b90d15d1985789aa10efa5b058a6550aac389db3eba42a4b7","win-x64/node_pdb.zip":"ae389590498393e57379d462b3d8d6c2639afcf04d6c279f99b8e2122b98b94e","win-x86/node.exe":"20fb3aa33b88628c533e59fec344db02683434cfbd91d70a36e3a0c3f865ed03","win-x86/node.lib":"caa896eb2249fdf32ed3dda1c7bdb8250b8dbdf6f5498b10a4dec91f541d2d11","win-x86/node_pdb.7z":"e2301d3ae38b01fecceb8111955568a741183de87d05c88a6499abfca1e913b1","win-x86/node_pdb.zip":"5d9cc82ef9f2165f08ad4057b23c90154bf6a334ed7f9d3b5757003f70f49108"}
gyp verb download contents checksum {"node-v13.1.0-headers.tar.gz":"577785216f5a4097a9108fd05f3117556f0954f0a03a26cfbfd1ce7af94587d4"}
gyp verb validating download checksum for node-v13.1.0-headers.tar.gz (577785216f5a4097a9108fd05f3117556f0954f0a03a26cfbfd1ce7af94587d4 == 577785216f5a4097a9108fd05f3117556f0954f0a03a26cfbfd1ce7af94587d4)
gyp verb get node dir target node version installed: 13.1.0
gyp verb build dir attempting to create "build" dir: /var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass/build
gyp verb build dir "build" dir needed to be created? /var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass/build/config.gypi
gyp verb config.gypi checking for gypi file: /var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass/config.gypi
gyp verb common.gypi checking for gypi file: /var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /usr/bin/python2
gyp info spawn args [
gyp info spawn args   '/var/lib/jenkins/workspace/Deploy UI/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/var/lib/jenkins/workspace/Deploy UI/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0',
gyp info spawn args   '-Dnode_gyp_dir=/var/lib/jenkins/workspace/Deploy UI/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir /var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass/build'
  g++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.4"' -I/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0/include/node -I/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0/src -I/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0/deps/openssl/config -I/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0/deps/openssl/openssl/include -I/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0/deps/uv/include -I/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0/deps/zlib -I/var/lib/jenkins/workspace/Deploy UI/.node-gyp/13.1.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++1y -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/ast.o ../src/libsass/src/ast.cpp
g++: error: UI/.node-gyp/13.1.0/include/node: No such file or directory
g++: error: UI/.node-gyp/13.1.0/src: No such file or directory
g++: error: UI/.node-gyp/13.1.0/deps/openssl/config: No such file or directory
g++: error: UI/.node-gyp/13.1.0/deps/openssl/openssl/include: No such file or directory
g++: error: UI/.node-gyp/13.1.0/deps/uv/include: No such file or directory
g++: error: UI/.node-gyp/13.1.0/deps/zlib: No such file or directory
g++: error: UI/.node-gyp/13.1.0/deps/v8/include: No such file or directory
src/libsass.target.mk:158: recipe for target 'Release/obj.target/libsass/src/libsass/src/ast.o' failed
make: *** [Release/obj.target/libsass/src/libsass/src/ast.o] Error 1
make: Leaving directory '/var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/var/lib/jenkins/workspace/Deploy UI/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.15.0-1052-aws
gyp ERR! command "/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 ERR! cwd /var/lib/jenkins/workspace/Deploy UI/node_modules/node-sass
gyp ERR! node -v v13.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.12.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@4.12.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above

**Tags:** jenkins, npm


---

## 1 answers

### Answer by username_1 on 2019-11-12. Score: 1

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

1. 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.
2. 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](https://github.com/nodejs/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](https://github.com/sass/node-sass/blob/master/TROUBLESHOOTING.md#linuxosx) 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.


---

