Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

node-sass install failing on jenkins #941

Closed
@ccnokes

Description

@ccnokes

On my Jenkins build process, it keeps failing while attempting to install node-sass (per the gulp-sass plugin).

The issue seems to be that node is not finding a script file during install. When I pull my repo locally on the server and install it, it installs without a problem.

Here's the error output:

> node-sass@2.1.1 install /root/.jenkins/jobs/odyssey-frontend/workspace/node_modules/gulp-sass/node_modules/node-sass
> node scripts/install.js

module.js:338
    throw err;
          ^
Error: Cannot find module '/root/.jenkins/jobs/odyssey-frontend/workspace/node_modules/gulp-sass/node_modules/node-sass/scripts/install.js'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3
npm ERR! Linux 3.14.35-28.38.amzn1.x86_64
npm ERR! argv "node" "/home/ec2-user/.linuxbrew/bin/npm" "install" "--production"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.6
npm ERR! code ELIFECYCLE

npm ERR! node-sass@2.1.1 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@2.1.1 install script 'node scripts/install.js'.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/.jenkins/jobs/odyssey-frontend/workspace/npm-debug.log
module.js:338
    throw err;
          ^
Error: Cannot find module 'gulp-sass'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/root/.jenkins/jobs/odyssey-frontend/workspace/gulpfile.js:11:12)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
Build step 'Execute shell' marked build as failure
Finished: FAILURE

The Linux distribution is Amazon Linux AMI, Fedora-like. Trying to install node-sass ^3.0.0 via gulp-sass ^2.0.0.

Has anyone else had a similar issue?

Activity

xzyfer

xzyfer commented on May 9, 2015

@xzyfer
Contributor

Hi @ccnokes, this is covered in our troubleshooting guide. https://github.com/sass/node-sass/blob/f2df3d90093adcc10dfbbefc74d3e32cdba82d2c/TROUBLESHOOTING.md#cannot-find-module-rootinstalljs

Npm prevents executing install scripts when run as root. This is a security measure in npm.

ccnokes

ccnokes commented on May 9, 2015

@ccnokes
Author

Right you are, it works once I add that flag. Sorry, I must have missed that in the docs. I appreciate your help though. Thanks!

kishoridu

kishoridu commented on Jun 2, 2017

@kishoridu

I am getting same error for Windows 7 x64 bit system. Tried the troubleshooting guide but didn't help.
I have no errors in task runner though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @xzyfer@ccnokes@kishoridu

        Issue actions

          node-sass install failing on jenkins · Issue #941 · sass/node-sass