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

Installation Failing (on Linux, Windows or Heroku etc.) #467

Closed
jedfoster opened this issue Oct 16, 2014 · 80 comments
Closed

Installation Failing (on Linux, Windows or Heroku etc.) #467

jedfoster opened this issue Oct 16, 2014 · 80 comments

Comments

@jedfoster
Copy link

Error:

-----> Rebuilding any native dependencies

       > node-sass@1.0.1 install /tmp/build_3550e8f7-0269-4253-a8cf-f39ff7f9d0fb/node_modules/node-sass
       > node build.js

       `linux-x64-v8-3.14` exists; testing
       make: Entering directory `/tmp/build_3550e8f7-0269-4253-a8cf-f39ff7f9d0fb/node_modules/node-sass/build'
         CXX(target) Release/obj.target/binding/binding.o
       cc1plus: error: unrecognized command line option "-std=c++11"
       cc1plus: error: unrecognized command line option "-std=c++11"
       make: *** [Release/obj.target/binding/binding.o] Error 1
       make: Leaving directory `/tmp/build_3550e8f7-0269-4253-a8cf-f39ff7f9d0fb/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 (/tmp/build_3550e8f7-0269-4253-a8cf-f39ff7f9d0fb/vendor/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
       gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
       gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:12)
       gyp ERR! System Linux 3.8.11-ec2
       gyp ERR! command "node" "/tmp/build_3550e8f7-0269-4253-a8cf-f39ff7f9d0fb/vendor/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
       gyp ERR! cwd /tmp/build_3550e8f7-0269-4253-a8cf-f39ff7f9d0fb/node_modules/node-sass
       gyp ERR! node -v v0.10.32
       gyp ERR! node-gyp -v v1.0.1
       gyp ERR! not ok
       Build failed

       npm ERR! node-sass@1.0.1 install: `node build.js`
       npm ERR! Exit status 1
       npm ERR!
       npm ERR! Failed at the node-sass@1.0.1 install script.
       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 build.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! System Linux 3.8.11-ec2
       npm ERR! command "/tmp/build_3550e8f7-0269-4253-a8cf-f39ff7f9d0fb/vendor/node/bin/node" "/tmp/build_3550e8f7-0269-4253-a8cf-f39ff7f9d0fb/vendor/node/bin/npm" "rebuild"
       npm ERR! cwd /tmp/build_3550e8f7-0269-4253-a8cf-f39ff7f9d0fb
       npm ERR! node -v v0.10.32
       npm ERR! npm -v 1.4.28
       npm ERR! code ELIFECYCLE
       npm ERR!
       npm ERR! Additional logging details can be found in:
       npm ERR!     /tmp/build_3550e8f7-0269-4253-a8cf-f39ff7f9d0fb/npm-debug.log
       npm ERR! not ok code 0

Full trace: https://gist.github.com/jedfoster/9e1e919c46ca1707dd2c

Am I doing it wrong?

@nschonni
Copy link
Contributor

Libsass now requires a C++ compiler that supports C++11. It isn't clear why the build is being forced though as node-sass ships with binaries for 0.10.32.

@Rowno
Copy link

Rowno commented Oct 17, 2014

I'm getting missing Python errors installing the latest node-sass on Windows 7. Looks like it's trying to build when it shouldn't need to, might be related?

@smashercosmo
Copy link

same problem ( build failed on windows 7

@am11
Copy link
Contributor

am11 commented Oct 17, 2014

It seems like it throws exception in one of these three lines: 37, 43 or 45 in build.js. The line 56 (inside catch block) triggers the rebuild.

For the record, I can't reproduce it locally in Win8.1.1 or Ubuntu12 with node v0.10.32.

@am11
Copy link
Contributor

am11 commented Oct 17, 2014

@nschonni to find out what's going wrong on those systems; can we make a debug release with fs.writeFileSync('./node-sass-debug.log', ex.message, 'utf8') to capture the exception at: build.js#L55?

@Subash
Copy link

Subash commented Oct 17, 2014

Here you go, console.log(ex)

windows_8__running_

@am11
Copy link
Contributor

am11 commented Oct 17, 2014

Could you try with node.exe x86-32 bit: http://nodejs.org/download/? First uninstall the exiting node and reinstall 32 bit. If that works, or gives different error, then this is one issue with x64 bit. I can think of few reasons; why it's happening.
If 32-bit throws some other error, please show it as well.

Thanks for diagnosing @Subash! 👍

@Subash
Copy link

Subash commented Oct 17, 2014

I guess the 64 bit pre-built binding has problems, I just installed 32 bit node and everything seems to be working fine.

@am11
Copy link
Contributor

am11 commented Oct 17, 2014

I think this is because, when I made the binary for x86-64 bit arch, I used the standalone copy of node.exe which somehow caused this erroneous binary. I think we need to have a separate VM configured for this thing.

But wait! going by this logic^^, there shouldn't be an issue with Linux build; as there I was using 64-bit version as installed and 32-bit as standalone. The log by @jedfoster says that the system wanted 64 bit version and found it. But yet the binary was flawed.

More weirdness to the mix; just installed on Ubuntu x64 VM with node x64, and it worked!

@jedfoster
Copy link
Author

I should add that it works just fine on my MacBook Pro. OS X 10.9.5.

@Subash
Copy link

Subash commented Oct 18, 2014

Failed on Ubuntu 32 bit as well,
ubuntu__running_

@am11
Copy link
Contributor

am11 commented Oct 18, 2014

The suitable solution would probably come from #56, when the binary building is automated via Vagrant.

For now, the work around is to install python 2.7.8 (with evn variable set) and C++11 compiler (GCC 4.8 or VS2013+ on Windows). The script will rebuild the binaries for your system.

@Subash
Copy link

Subash commented Oct 18, 2014

@am11 I don't have 64 bit ubuntu but I will try to contribute 32 bit ubuntu binary,

@Subash
Copy link

Subash commented Oct 18, 2014

@am11 How did you generate the bindings ?

@am11
Copy link
Contributor

am11 commented Oct 18, 2014

@Subash, that would be awesome!

The repository is located here https://github.com/sass/node-sass-binaries:

First, fork both repos: node-sass and node-sass-binaries.

README has it, but here is how I do it:

Linux:

# given you have GCC 4.8 installed
# (see https://github.com/sass/node-sass/blob/master/.travis.yml for installation commands),
# After that:
git clone --recursive https://github.com/subash/node-sass/
git remote add node-sass https://github.com/sass/node-sass/

git clone https://github.com/subash/node-sass-binaries/
git remote add node-sass-binaries https://github.com/sass/node-sass-binaries/

cd node-sass
git submodule update --init --recursive
npm install
npm install -g node-gyp

rm -r build/; rm -r bin/linux-ia32-v8-3.14; rm -r bin/linux-x64-v8-3.14
node build

# test it
npm test

# copy the bin/linux* folder and replace to its conterpart in node-sass-binaries, then
git add .
git commit -am "Linux: Binaries updated for (x86-32)." # or 64
git push

# then make a PR on node-sass-binaries repository.

Windows (using PowerShell, the one with SSH and Git support; that comes with http://windows.github.com/):

# given you have VS2013 Update 3 (Pro or Express for desktop) installed
# then fork both repos; node-sass and node-sass-binaries.
# After that:
git clone --recursive https://github.com/subash/node-sass/
git remote add node-sass https://github.com/sass/node-sass/

git clone https://github.com/subash/node-sass-binaries/
git remote add node-sass-binaries https://github.com/sass/node-sass-binaries/

cd node-sass
git submodule update --init --recursive
npm install
npm install -g node-gyp

rm -r build/; rm -r bin/win32-ia32-v8-3.14; rm -r bin/windows-x64-v8-3.14
node build

# test it
npm test

# copy the bin/linux* folder and replace to its conterpart in node-sass-binaries, then
git add .
git commit -am "Windows: Binaries updated for (x86-32)." # or 64
git push

# then make a PR on node-sass-binaries repository

@am11
Copy link
Contributor

am11 commented Oct 20, 2014

Built on one machine, failed to run on another.

There is something really wrong with our build system (the compiler switches and all). This issue is recurring since 2012: #13.

@DESIGNfromWITHIN
Copy link

Same issue here...

10927 info install node-sass@1.0.0
10928 verbose unsafe-perm in lifecycle true
10929 info node-sass@1.0.0 Failed to exec install script
10930 info D:\Projects\VPS Tampa\envirotechequipment.net\www\assets\templates\anyscreensize\node_modules\node-sass unbuild
10931 info preuninstall node-sass@1.0.0
10932 info uninstall node-sass@1.0.0
10933 verbose true,D:\Projects\VPS Tampa\envirotechequipment.net\www\assets\templates\anyscreensize\node_modules,D:\Projects\VPS Tampa\envirotechequipment.net\www\assets\templates\anyscreensize\node_modules unbuild node-sass@1.0.0
10934 verbose D:\Projects\VPS Tampa\envirotechequipment.net\www\assets\templates\anyscreensize\node_modules.bin,[object Object] binRoot
10935 info postuninstall node-sass@1.0.0
10936 error node-sass@1.0.0 install: node build.js
10936 error Exit status 1
10937 error Failed at the node-sass@1.0.0 install script.
10937 error This is most likely a problem with the node-sass package,
10937 error not with npm itself.
10937 error Tell the author that this fails on your system:
10937 error node build.js
10937 error You can get their info via:
10937 error npm owner ls node-sass
10937 error There is likely additional logging output above.
10938 error System Windows_NT 6.1.7601
10939 error command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "node-sass@1.0.0" "--save-dev"
10940 error cwd D:\Projects\VPS Tampa\envirotechequipment.net\www\assets\templates\anyscreensize
10941 error node -v v0.10.25
10942 error npm -v 1.3.24
10943 error code ELIFECYCLE
10944 verbose exit [ 1, true ]

@jedfoster
Copy link
Author

Interestingly, my node-sass app builds and runs on a Digital Ocean droplet.

Ubuntu 14.04 x64 vmlinuz-3.13.0-24-generic, deployed with Dokku.

@DESIGNfromWITHIN
Copy link

I just uninstalled NodeJS x64 and downloaded+installed the 32 bit version.
And it works! Thanks for the tip guys.

Must be a issue with the x64 version of NodeJS

@opeologist
Copy link

^ same. will compile times decrease further using x64 once the build errors get resolved? i'm under the impression they will, but don't know/understand 100%

@cesarandreu
Copy link

👍 having same issue with Heroku

@kevinansfield
Copy link

This just stopped me from deploying to heroku:

-----> Installing dependencies

       > node-sass@1.1.4 install /tmp/build_8a95c13164678ab76941f78ffbf0037a/node_modules/broccoli-sass/node_modules/node-sass
       > node build.js

       `linux-x64-v8-3.14` exists; testing
       make: Entering directory `/tmp/build_8a95c13164678ab76941f78ffbf0037a/node_modules/broccoli-sass/node_modules/node-sass/build'
         CXX(target) Release/obj.target/binding/binding.o
       cc1plus: error: unrecognized command line option "-std=c++11"
       cc1plus: error: unrecognized command line option "-std=c++11"
       make: *** [Release/obj.target/binding/binding.o] Error 1
       make: Leaving directory `/tmp/build_8a95c13164678ab76941f78ffbf0037a/node_modules/broccoli-sass/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 (/tmp/build_8a95c13164678ab76941f78ffbf0037a/vendor/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
       gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
       gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:12)
       gyp ERR! System Linux 3.8.11-ec2
       gyp ERR! command "node" "/tmp/build_8a95c13164678ab76941f78ffbf0037a/vendor/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
       gyp ERR! cwd /tmp/build_8a95c13164678ab76941f78ffbf0037a/node_modules/broccoli-sass/node_modules/node-sass
       gyp ERR! node -v v0.10.33
       gyp ERR! node-gyp -v v1.0.1
       gyp ERR! not ok 
       Build failed
       npm ERR! node-sass@1.1.4 install: `node build.js`
       npm ERR! Exit status 1
       npm ERR! 
       npm ERR! Failed at the node-sass@1.1.4 install script.
       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 build.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! System Linux 3.8.11-ec2
       npm ERR! command "/tmp/build_8a95c13164678ab76941f78ffbf0037a/vendor/node/bin/node" "/tmp/build_8a95c13164678ab76941f78ffbf0037a/vendor/node/bin/npm" "install" "--quiet" "--userconfig" "/tmp/build_8a95c13164678ab76941f78ffbf0037a/.npmrc"
       npm ERR! cwd /tmp/build_8a95c13164678ab76941f78ffbf0037a
       npm ERR! node -v v0.10.33
       npm ERR! npm -v 1.4.28
       npm ERR! code ELIFECYCLE
       npm ERR! not ok code 0

 !     Push rejected, failed to compile Ember CLI app

As far as I understand it, the suggested workaround is not possible on Heroku?

@flavioribeiro
Copy link

same problem here, trying to install gulp-sass on drone.io: https://travis-ci.org/globocom/clappr/builds/39981423

@am11
Copy link
Contributor

am11 commented Nov 4, 2014

Guys, we are tracking this issue at #497. Nonetheless, the actual solution would be something like #56.

@kevinansfield, that's right. The workaround wouldn't work for heorku as is. You can, however, build on *nix-x64 with node-x64 and restore the package manually (remove it as dependency). After cloning repo: mv workaorund/node-sass node_module/node-sass. Not the best workaround but it would do the job for time being I assume..

@jmonster
Copy link

jmonster commented Nov 4, 2014

We have a solution (for Heroku) :)

Heroku released a new, up to date stack today: https://blog.heroku.com/archives/2014/11/4/cedar_14_now_generally_available

This stack has the necessary libs for the building of node-sass to succeed! HURRAY!

Migrate your ember-cli-heroku-app / create a new one on this stack and the push should succeed!

@guillaumepotier
Copy link

I have a fix for Travis too, updating g++ like explained here.

@flavioribeiro
Copy link

ty @guillaumepotier

@micahlmartin
Copy link

I'm running on the latest cedar-14 stack on heroku but still getting the error:

       > node-sass@1.2.2 postinstall /tmp/build_09f0d25ca40e6d71d0050196bf9c0fd6/node_modules/node-sass
       > node scripts/build.js

       `linux-x64-v8-3.14` exists; testing
       Binary is fine; exiting
       npm ERR! cb() never called!
       npm ERR! not ok code 0

 !     Push rejected, failed to compile Node.js app```

@backflip
Copy link

backflip commented Nov 7, 2014

cb() never called might be an unrelated issues (see npm/npm#6485, e.g.). Which version of npm are you using?

@micahlmartin
Copy link

I've tried a few different version but on Heroku it ignores the specified npm version and uses the version packaged with node. I'm using version 0.10.33 of node.

@jmonster
Copy link

jmonster commented Nov 8, 2014

Can you share part of your package.json? I've been able to specify npm before so that may be a regression.

@micahlmartin
Copy link

So it seems like issue may be related to the npm version. Unfortunately on heroku you can't specify a npm version. It uses the version that is packaged with node. I was able to create a custom buildpack that updates the latest npm https://github.com/micahlmartin/heroku-buildpack-nodejs. Here's the app I'm trying to deploy: https://github.com/micahlmartin/nuts. I was able to get it to work in this case.

@jmonster
Copy link

fyi there is a branch which uses the latest npm called npm-next: https://github.com/heroku/heroku-buildpack-nodejs/tree/npm-next

@boopathi
Copy link

Getting this on OSX Yosemite.

-
> node-sass@1.2.3 install /Users/boopathi/workspace/labyrinth/node_modules/node-sass
> node scripts/install.js

Binary downloaded and installed at /Users/boopathi/workspace/labyrinth/node_modules/node-sass/vendor/darwin-x64/binding.node

> node-sass@1.2.3 postinstall /Users/boopathi/workspace/labyrinth/node_modules/node-sass
> node scripts/build.js

`darwin-x64` exists; testing
module.js:355
  Module._extensions[extension](this, filename);
                               ^
Error: Module did not self-register.
    at Error (native)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/boopathi/workspace/labyrinth/node_modules/node-sass/lib/index.js:181:15)
    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)

@szimek
Copy link

szimek commented Dec 27, 2014

EDIT: Migrating to Cedar-14 stack on Heroku solved this problem.

I'm trying to switch to node-sass from Ruby version and got the following error while trying to deploy it to Heroku with their new Node buildpack (https://github.com/heroku/heroku-buildpack-nodejs/tree/yoga) with npm 2.1.16:

-----> Building dependencies
       New buildpack version (63-rc); invalidating cache
       Installing node modules

> node-sass@1.2.3 install /tmp/build_15d91b93a128c32017ee1f281d8aae65/node_modules/grunt-sass/node_modules/node-sass
> node scripts/install.js

Binary downloaded and installed at /tmp/build_15d91b93a128c32017ee1f281d8aae65/node_modules/grunt-sass/node_modules/node-sass/vendor/linux-x64/binding.node

> node-sass@1.2.3 postinstall /tmp/build_15d91b93a128c32017ee1f281d8aae65/node_modules/grunt-sass/node_modules/node-sass
> node scripts/build.js

`linux-x64` exists; testing

module.js:356
  Module._extensions[extension](this, filename);
                               ^
Error: /usr/lib/libstdc++.so.6: version `CXXABI_1.3.5' not found (required by /tmp/build_15d91b93a128c32017ee1f281d8aae65/node_modules/grunt-sass/node_modules/node-sass/vendor/linux-x64/binding.node)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/tmp/build_15d91b93a128c32017ee1f281d8aae65/node_modules/grunt-sass/node_modules/node-sass/lib/index.js:181:15)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
npm ERR! Linux 3.8.11-ec2
npm ERR! argv "node" "/tmp/build_15d91b93a128c32017ee1f281d8aae65/.heroku/node/bin/npm" "install" "--quiet" "--userconfig" "/tmp/build_15d91b93a128c32017ee1f281d8aae65/.npmrc"
npm ERR! node v0.10.33
npm ERR! npm  v2.1.16
npm ERR! code ELIFECYCLE

npm ERR! node-sass@1.2.3 postinstall: `node scripts/build.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the node-sass@1.2.3 postinstall script 'node scripts/build.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/build.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.

Is it something that's possible to fix on my end or is it an issue with Heroku?

@micahlmartin
Copy link

For anyone still having issues, upgrading to version node-sass@2.0.0-beta worked for me.

@boopathi
Copy link

2.0.0-beta works!

@augustine-tran
Copy link

2.0.0-beta works on Yosemite. Thanks micahlmartin.

@xzyfer
Copy link
Contributor

xzyfer commented Feb 15, 2015

@rualatngua 2.0.1 stable is out. npm install node-sass@2.0.1

@listenrightmeow
Copy link

This issue is back on 2.0.1(node 0.10.36). I had to manually install 2.0.0-beta to get this installed on Ubuntu.

@trompx
Copy link

trompx commented Apr 1, 2015

Hi,

I have problems too. I tried the following versions :
nodejs : 0.12.2
node-sass : 2.1.1
grunt-sass : 0.18.0

This config works on my host machine (windows 8.1) but I get the following error on my ubuntu 14.04 VM :
"Error: libsass bindings not found. Try reinstalling node-sass?"

I manage to make this works on the ubuntu VM with the following versions :
nodejs : 0.10.35
node-sass : 2.0.0-beta
grunt-sass : 0.17.0

Hope this helps!

@saper
Copy link
Member

saper commented Sep 23, 2015

@trompx you are using obsolete versions of node-sass - besides if you share a directory between two platforms (operating systems) you need have two binaries installed so do npm install node-sass needs to be one on both systems.

@mgol
Copy link
Contributor

mgol commented Sep 23, 2015

@saper I believe npm rebuild should fix node_modules installed via a different Node version or on a different platform.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests