Node-sass: Install issue (Amazon Linux AMI / Elastic Beanstalk)

Created on 25 Mar 2015  路  10Comments  路  Source: sass/node-sass

I'm getting an installation error from node-sass which is one of laravel-elixir's dependencies:

> [email protected] install /var/app/ondeck/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass
> node scripts/install.js

npm ERR! Linux 3.14.20-20.44.amzn1.x86_64
npm ERR! argv "node" "/usr/bin/npm" "install"
npm ERR! node v0.10.33
npm ERR! npm  v2.7.3
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn

npm ERR! [email protected] install: `node scripts/install.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the [email protected] 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!     /var/app/ondeck/npm-debug.log

Extract from NPM Debug (let me know if you need the entire file):

https://gist.github.com/RTC1/62438cb9157e52f8b59a/raw/gistfile1.txt

Bug - Maybe

Most helpful comment

I fixed this by adding the HOME & PATH environment variables when calling NPM install (.ebextensions). Not sure why it only effected this plugin.

    "10-install-npm-packages": {
      "env": {
        "HOME": "/root",
        "PATH": "/usr/bin:/usr/lib/node_modules:/sbin:/bin:/usr/sbin:/opt/aws/bin"
      },
      "command": "npm install"

All 10 comments

Hi, thanks for the report.

I think it is failing when try to download the binary. To verify, please try npm install [email protected] on same VM and check if it is still broken.

Aside: you are having a very old version of node.js v0.10.33 (current stable version is v0.12.1 and latest in 0.10 branch is v0.10.38: https://nodejs.org/dist/) with the latest version of npm (https://github.com/npm/npm/releases/tag/v2.7.3). That might be causing the underlying issue, but I am unsure at this point.

I ran that command and it worked fine - it only seems to error when npm install is being ran by the build process (however it installs many other packages ok).

The NPM package was updated following a suggestion that it may fix the issue. Unfortunately NodeJS cannot be updated as Amazon have yet to release a new Linux AMI for Elastic Beanstalk PHP.

With older version:

[email protected] install /var/app/ondeck/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass
node scripts/install.js

npm ERR! Error: spawn ENOENT
npm ERR!     at errnoException (child_process.js:1001:11)
npm ERR!     at Process.ChildProcess._handle.onexit (child_process.js:792:34)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <[email protected]>

npm ERR! System Linux 3.14.20-20.44.amzn1.x86_64
npm ERR! command "node" "/usr/bin/npm" "install"
npm ERR! cwd /var/app/ondeck
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.3.6
npm ERR! syscall spawn
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /var/app/ondeck/npm-debug.log
npm ERR! not ok code 0

Is it worth trying different versions of gulp-sass?

Please try with node-sass v2.1.1.

I fixed this by adding the HOME & PATH environment variables when calling NPM install (.ebextensions). Not sure why it only effected this plugin.

    "10-install-npm-packages": {
      "env": {
        "HOME": "/root",
        "PATH": "/usr/bin:/usr/lib/node_modules:/sbin:/bin:/usr/sbin:/opt/aws/bin"
      },
      "command": "npm install"

@RTC1 where does that json go?

That goes in the .ebextensions folder if you're using AWS Elastic Beanstalk. If you're not using EB but encountering the above error, just make sure those environment variables are set (HOME & PATH).

I have an app.config and config.yml in those folders, can they be json?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NathanKleekamp picture NathanKleekamp  路  4Comments

Pixelatex picture Pixelatex  路  3Comments

amarbham picture amarbham  路  3Comments

liuyuqiang picture liuyuqiang  路  3Comments

harukaeru picture harukaeru  路  3Comments