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

npm ERR! node-sass@1.1.0 install: node build.js #490

Closed
shivanibhanwal opened this issue Oct 29, 2014 · 62 comments
Closed

npm ERR! node-sass@1.1.0 install: node build.js #490

shivanibhanwal opened this issue Oct 29, 2014 · 62 comments

Comments

@shivanibhanwal
Copy link

We are running into issue while travis tries to build our code. Here are the details.
Looks like for some reason node-sass@1.1.0 is failing.

Failed at the node-sass@1.1.0 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.

Thank you
Looking for your quick response.

@am11
Copy link
Contributor

am11 commented Oct 29, 2014

See this: #487 (comment)
I am working on the fix. :D

@shivanibhanwal
Copy link
Author

Thank you!

@andrew
Copy link
Contributor

andrew commented Oct 29, 2014

@shivanibhanwal
Copy link
Author

Now it is picking up 1.1.3

Failed at the node-sass@1.1.3 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.

@shivanibhanwal
Copy link
Author

Problem is I am using broccoli-sass package and that internally uses node-sass. So when I retried it is now picking 1.1.3 version instead of 1.1.1

@am11
Copy link
Contributor

am11 commented Oct 29, 2014

Yes v1.1.3 was a quick release after 1.1.1.

Are you running on Windows? x64 or x86? Also, please tell the node.exe arch: node -e "console.log(process.arch)".

@am11
Copy link
Contributor

am11 commented Oct 29, 2014

Or more simply node -p "process.arch" 😄

@banyan
Copy link

banyan commented Oct 29, 2014

Also it happened to me after 1.1.0 is released.

$ node -p "process.arch"
x64
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.5 LTS"
$ arch
x86_64

Please let me know more info is needed.
https://gist.github.com/banyan/ac9a1c171d605ed24d71

@am11
Copy link
Contributor

am11 commented Oct 29, 2014

@banyan, which OS?

@am11
Copy link
Contributor

am11 commented Oct 29, 2014

linux-x64-v8-3.14 got it 😄

@ajoslin
Copy link

ajoslin commented Oct 29, 2014

node-sass 1.1.3 build is failing for us, too, on linux-x64-v8-3.14.

We're using gulp-sass, which depends on node-sass, and the latest version fails on Linux.

https://travis-ci.org/angular/material/builds/39402854

Anything I can do to help fix this?

@andrew
Copy link
Contributor

andrew commented Oct 29, 2014

Anyone having linux issues, please try installing v1.1.4: https://github.com/sass/node-sass/releases/tag/v1.1.4

@john-kurkowski
Copy link

No dice.

29-Oct-2014 17:42:08    cc1plus: error: unrecognized command line option ?-std=c++11?
29-Oct-2014 17:42:08    cc1plus: error: unrecognized command line option ?-std=c++11?
29-Oct-2014 17:42:08    make[1]: *** [Release/obj.target/binding/binding.o] Error 1
29-Oct-2014 17:42:08    gyp ERR! build error
29-Oct-2014 17:42:08    gyp ERR! stack Error: `make` failed with exit code: 2
29-Oct-2014 17:42:08    gyp ERR! stack     at ChildProcess.onExit (~/.nvm/v0.10.28/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
29-Oct-2014 17:42:08    gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
29-Oct-2014 17:42:08    gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:807:12)
29-Oct-2014 17:42:08    gyp ERR! System Linux 3.2.0-31-generic
...
29-Oct-2014 17:42:09    npm ERR! node-sass@1.1.4 install: `node build.js`
29-Oct-2014 17:42:09    npm ERR! Exit status 1

@ajoslin
Copy link

ajoslin commented Oct 29, 2014

Same.

make: Entering directory `/home/travis/build/angular/material/node_modules/gulp-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 `/home/travis/build/angular/material/node_modules/gulp-sass/node_modules/node-sass/build'

https://travis-ci.org/angular/material/builds/39408162

@fraklo
Copy link

fraklo commented Oct 29, 2014

Same here

make: Entering directory `/pipeline/build/node_modules/gulp-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 `/pipeline/build/node_modules/gulp-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 (/usr/local/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.2.0-54-virtual
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /pipeline/build/node_modules/gulp-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.2.0-54-virtual
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! cwd /pipeline/build
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

@naomiblack
Copy link

@am11 @andrew can we do anything to help debug? We rely on node-sass for angular-material and this is holding up a release. Any updates? I can come up with a backup plan but would rather wait if you're close to resolving (or we can help somehow).

@andrew
Copy link
Contributor

andrew commented Oct 30, 2014

@naomiblack I'm not going to have any time to investigate the issue today, to resolve your issue quickly you could pin the version of node-sass to a known working version by adding the following to the dependencies section of your package.json:

"node-sass": "1.0.3",

@ajoslin
Copy link

ajoslin commented Oct 30, 2014

Unfortunately, we depend upon gulp-sass's latest version, which depends too loosely upon node-sass.

And we do need the latest version of gulp-sass because use sass maps.

I'll just fork gulp-sass for now and depend on that.

@fraklo
Copy link

fraklo commented Oct 30, 2014

@ajoslin Yeah, same here with gulp-sass. Ended up forking as well.

@john-kurkowski
Copy link

Another workaround for transitive node-sass dependencies, without forking, is installing node-sass 1.0.3 wherever node-sass appears in the depths of your node_modules folder. Then use npm shrinkwrap on your top-level project.

@guillaumepotier
Copy link

Hi there, I stumbled upon this issue too on Travis, and a good fix I used is to update Travis g++ before running npm install. Hope that helps.

@wcandillon
Copy link

@guillaumepotier thks for the tip

@RobLoach
Copy link

RobLoach commented Nov 5, 2014

1.1.4 is still problematic.

@guillaumepotier 's note of http://gearchicken.com/wordpress/?p=105 is a good workaround in the mean time.

@localjo
Copy link

localjo commented Nov 6, 2014

Tried a similar fix to @guillaumepotier in CircleCI;

machine:
  post:
    - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
    - sudo apt-get update -qq
    - sudo apt-get install -qq gcc-4.8 g++-4.8
    - sudo update-alternatives --install /usr/bin/g++ g++ /usr

It worked a few days ago, but today the same builds are failing with "Error: libsass bindings not found. Try reinstalling node-sass?"

After looking into things closer, what it seems to boil down to is something in scripts/install.js that was added two days ago: d4b8f6b#diff-153f7a81745c9180edcfa4838beeae7bR62

If I ssh into Circle, remove the line that skips downloading binaries on CI builds, and then manually run install.js, it resolves my errors.

I don't know enough about what's going on here to know why downloading the binaries is skipped on a CI build. This might be getting into a separate issue, but right now, to get around this, I've set the environment variable CI=false before running npm install gulp-sass.

cc @kevva

@am11
Copy link
Contributor

am11 commented Nov 7, 2014

@josiahsprague, on CI, we need to test the build step, so we skip downloading the prebuild package and build the process again. I agree there must be a switch to skip it as well. But this is for our CI configuration; Travis and Appveyor.

@house9
Copy link

house9 commented Nov 7, 2014

Thanks to @josiahsprague and @guillaumepotier posts above I was able to get this to install on circleCI, the key was setting CI to nothing when running npm install, i.e. CI= npm install

The circle.yml config I ended up using

machine:
  node:
    version: 0.10.32
  post:
    - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
    - sudo apt-get update -qq
    - sudo apt-get install -qq gcc-4.8 g++-4.8
    - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90
dependencies:
  pre:
    - npm install -g bower
    - npm install -g ember-cli
    - npm install -g phantomjs
  override:
    - CI= npm install
    - bower install

@vlkz
Copy link

vlkz commented Jan 17, 2015

Downgrading node latest stable v0.10 worked for me.

On Sat, Jan 17, 2015 at 4:48 PM, Vaidas Mykolaitis <notifications@github.com

wrote:

I am getting similar problems:

node-sass@1.2.3 install /Users/johndoe/playground/something/node_modules/broccoli-sass/node_modules/node-sass
node scripts/install.js

Binary downloaded and installed at /Users/johndoe/playground/something/node_modules/broccoli-sass/node_modules/node-sass/vendor/darwin-x64/binding.node

node-sass@1.2.3 postinstall /Users/johndoe/playground/something/node_modules/broccoli-sass/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. (/Users/johndoe/playground/something/node_modules/broccoli-sass/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)

npm ERR! Darwin 14.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "broccoli-sass"
npm ERR! node v0.11.14
npm ERR! npm v2.0.0
npm ERR! code ELIFECYCLE
npm ERR! node-sass@1.2.3 postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@1.2.3 postinstall 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 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.


Reply to this email directly or view it on GitHub
#490 (comment).

@codepreneur
Copy link

Downgrading to Node 0.10.32 also worked for me, but ideally this should work with 0.11.14 also...

@ferrybrouwer
Copy link

This is a known issue for node version v0.11.13 and v0.11.14.
I wrote a patch to solve this issue:
https://github.com/ferrybrouwer/node-sass-patch

@codepreneur
Copy link

Now that Node 0.12.0 got released and npm 2.5.1 maybe its time to fix this...

@xzyfer
Copy link
Contributor

xzyfer commented Feb 9, 2015

As per #627 (comment) node 0.12.x will be supported in the upcoming 2.0.0 stable release.

@albertpak
Copy link

I got this issue today - node v 0.12.0 & npm 2.5.1 - error came up as soon as i upgraded to 0.12

@vlkz
Copy link

vlkz commented Feb 13, 2015

Not stable. Only use 0.10

On Fri, Feb 13, 2015 at 11:16 AM, Al notifications@github.com wrote:

I got this issue today - node v 0.12.0 & npm 2.5.1 - error came up as soon
as i upgraded to 0.12


Reply to this email directly or view it on GitHub
#490 (comment).

@kevva
Copy link
Member

kevva commented Feb 13, 2015

@albertpak, npm install node-sass@2.

@albertpak
Copy link

@kevva thank you, that command worked, but looks like my issue is related to broccoli-sass package and it's incompatibility with v0.12.0

@xzyfer
Copy link
Contributor

xzyfer commented Feb 14, 2015

Correct. They still using node-sass < 2. If you create an issue with them
and tag me I'll submit a patch shortly.
On 14 Feb 2015 04:39, "Al" notifications@github.com wrote:

@kevva https://github.com/kevva thank you, that command worked, but
looks like my issue is related to broccoli-sass package and it's
incompatibility with v0.12.0


Reply to this email directly or view it on GitHub
#490 (comment).

@mikemaccana
Copy link

Thanks @kevva, npm install node-sass@2 is working fine.

@fitzmx6
Copy link

fitzmx6 commented Apr 2, 2015

@kevva npm install node-sass@2 worked for me but could you explain what this is doing in more depth so I can further diagnoses my issue with "node-sass": "~1.0.1"

@am11
Copy link
Contributor

am11 commented Apr 3, 2015

@fitzmx6, lets put it this way: there was a bug in the install script of version 1.0.1, which was fixed in v2.

@azkaiart
Copy link

I can't get npm install node-sass@2 to fix my issue.

Node v 0.12.2
NPM v 2.7.4

Libsass binding isn't working for gulp-sass. Also tried Node v 10.3 and Node v 11

Tried install node-sass@2 and regular node-sass. Also cleared cache and made sure NPM was updated. Still receiving the error. What am I doing wrong? :(


Edit: Ran npm remove -g node-sass and npm remove gulp-sass, reinstalled both without specific versions, and it worked. Had to do -g and --save-dev both.

@xzyfer
Copy link
Contributor

xzyfer commented May 11, 2015

I believe node-sass v2 doesn't support node 0.12. Please upgrade to
node-sass v3. This is supported by gulp-sass v2.
On 12 May 2015 02:20, "Kai (AzKai)" notifications@github.com wrote:

I can't get npm install node-sass@2 to fix my issue.

Node v 0.12.2
NPM v 2.7.4

Libsass binding isn't working for gulp-sass. Also tried Node v 10.3 and
Node v 11

Tried install node-sass@2 and regular node-sass. Also cleared cache and
made sure NPM was updated. Still receiving the error. What am I doing
wrong? :(


Reply to this email directly or view it on GitHub
#490 (comment).

@xzyfer
Copy link
Contributor

xzyfer commented May 11, 2015

You should never have to use -g. The reason the above steps works is because your install would have installed gulp-sass v2 which has node-sass v3 which supports node 0.12

@tox2ik
Copy link

tox2ik commented Sep 4, 2015

On Windows 7, there is an issue with a sub-process (postinstall, build). Some kind of permission error. This worked for me (from a run-as-admin cygwin shell):

$ npm install node-sass --ignore-scripts
$ cd node_modules/node-sass
$ node scripts/install.js
$ node scripts/build.js
$ cd ../..
$ npm install gulp-sass

Somehow, invoking the interpreter on the build and install scripts directly circumvents the issue.

The error I encountered:

This version of C:\cygwin64\home\jaroslav\bin\node.exe is not compatible with the version of  Windows you're running. Check your computer's system information to see whether you need a x86 (32-bit) or x64 (64-bit) version of th e program, and then contact the software publisher.
npm verb unsafe-perm in lifecycle true
npm info node-sass@3.3.2 Failed to exec install script
npm verb unlock done using C:\Users\jaroslav\AppData\Roaming\npm-cache\_locks\node-sass-54197d3c54cbe886.lock for H:\workspace\web-start\node_modules\node-sass
npm verb stack Error: node-sass@3.3.2 install: `node scripts/install.js`
npm verb stack Exit status 1
npm verb stack     at EventEmitter. (W:\development\js\nodejs\node_modules\npm\lib\utils\lifecycle.js:213:16)
npm verb stack     at EventEmitter.emit (events.js:110:17)
npm verb stack     at ChildProcess. (W:\development\js\nodejs\node_modules\npm\lib\utils\spawn.js:14:12)
npm verb stack     at ChildProcess.emit (events.js:110:17)
npm verb stack     at maybeClose (child_process.js:1015:16)
npm verb stack     at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
npm verb pkgid node-sass@3.3.2
npm verb cwd H:\workspace\web-start
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "W:\\development\\js\\nodejs\\node.exe" "W:\\development\\js\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-sass" "--verbose"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code ELIFECYCLE
![web-start sass](https://cloud.githubusercontent.com/assets/890081/9690272/a0fe9a3c-533b-11e5-8fd5-0f42ae71ecea.png)

@am11
Copy link
Contributor

am11 commented Sep 4, 2015

@tox2ik, the compatibility error you are getting is probably because the Cygwin process is 32-bit and node.exe is 64-bit. You can trying running the same command in normal CMD and it should work: Run>cmd>npm install node-sass provided you have node.exe and npm.exe in PATH (which obviously you get latest from https://nodejs.org/ and the installer -- by default -- sets the PATH for you).

Separately, in order to get better reception, please try opening new issues in future, as opposed to continuing discussion on the closed issue.

@JamesVanWaza
Copy link

I am also getting that error, when I install node-sass,

My Current Version of Node 4.21

Current Version of Node SASS After Installation node-sass@2.0.1

@saper
Copy link
Member

saper commented Nov 7, 2015

@jgacuca567 your node-sass is too old for node 4, please use the latest version.

@JamesVanWaza
Copy link

@saper, I was able to update node-sass to Version 3.41. Still getting an error of libsass bindings not being found.

@saper
Copy link
Member

saper commented Nov 7, 2015

We need a full debug log output to troubleshoot this. Try npm rebuild as well.

@JamesVanWaza
Copy link

@saper, I actually made it work. After updating individual npm modules without using sudo, when I run grunt, the only error I now receive is compass related.

@saper
Copy link
Member

saper commented Nov 7, 2015

Good to hear! Compass will not work with node-sass, you might want to check out eyeglass.

@JamesVanWaza
Copy link

@saper, Grunt is running smoothly, For the node-sass, you can also say in the documentation that it doesn't have to be installed with sudo

@xzyfer
Copy link
Contributor

xzyfer commented Nov 13, 2015

npm should never be run with sudo

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