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

Node-sass build issue when trying to install grunt-sass #635

Closed
ajshortt opened this issue Jan 21, 2015 · 14 comments
Closed

Node-sass build issue when trying to install grunt-sass #635

ajshortt opened this issue Jan 21, 2015 · 14 comments

Comments

@ajshortt
Copy link

Basically when i try to npm install grunt-sass, node-sass is having problems build on my machine

node scripts/build.js

CXX(target) Release/obj.target/binding/src/binding.o
cc1plus: error: unrecognized command line option "-std=c++11"
cc1plus: error: unrecognized command line option "-stdlib=libc++"
make: *** [Release/obj.target/binding/src/binding.o] Error 1
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:820:12)
gyp ERR! System Darwin 10.8.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/admin/htdocs/mm-2015/wp-content/themes/mm-2015/node_modules/grunt-sass/node_modules/node-sass
gyp ERR! node -v v0.10.35
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
Build failed

Any help please

@xzyfer
Copy link
Contributor

xzyfer commented Jan 21, 2015

gyp ERR! System Darwin 10.8.0

@ajshortt can you please confirm which version of osx you are using, and provide the output of gcc --version

@am11 could if be that the osx binaries don't support such an old version of osx?

@am11
Copy link
Contributor

am11 commented Jan 22, 2015

I don't know which version of node-sass OP is installing. It seems like grunt sass is bypassing the prebuild binary download.

@jasonsanjose, can you show us the full log (and wrap it inside ```, so it is readable, see https://help.github.com/articles/github-flavored-markdown/#fenced-code-blocks)?

@jasonsanjose
Copy link
Contributor

@am11 did you mean to tag me? I don't think I've been on this issue.

@am11
Copy link
Contributor

am11 commented Jan 22, 2015

@jasonsanjose, i apologies. I was meaning to tag @ajshortt. I don't know how the auto-completion mixed it up. Though I blame myself for using Tab key so blindly.. 👎

@ajshortt
Copy link
Author

@xzyfer,
ProductVersion: 10.9.5
BuildVersion: 13F34

gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

@am11
Copy link
Contributor

am11 commented Jan 22, 2015

@ajshortt, you need to update gcc to at least 4.6 in order to build libsass manually. But you shouldn't be building it manually if the intention is just to install node sass via npm (but to use prebuild binary).

@am11
Copy link
Contributor

am11 commented Jan 22, 2015

Having said that, we need the output of npm install node-sass in order to declare a compatibility issue or external (grunt-sass).

@ajshortt
Copy link
Author

@am11 I have made the biggest mistake of my life! I was ssh'd into our dev server and didnt realize. The server is old and probably needs updated xcode etc to get the latest gcc. Thanks for the help though guys

@snowliondev
Copy link

Not sure if this is the same issue but I am being kick into a console when trying to run 'sudo npm install'. It seems to to be having problems as soon as it tried to install the node-sass. I am just following the FoundationPress install https://github.com/olefredrik/foundationpress/ which is a grunt build. It kicks me into this as soon as the node-sass part of the install comes...

node-sass@1.2.3 install /Users/me/FPnew/node_modules/node-sass
node scripts/install.js

@am11
Copy link
Contributor

am11 commented Jan 26, 2015

@snowliondev, in order to isolate the issue, you can try installing node-sass separately:

npm -v
node -v
node -p process.versions
node -p process.arch
node -p process.platform

mkdir /temp
cd /temp
npm install node-sass   # should install v2.0.0-beta

# if you have reached this far without any error,
# then you should be able to run:
node -e "console.warn(require('node-sass').info())"

If you get any error, please post the logs.

@damonsmith
Copy link

I am having the same problem, I just tried this too, here's my system and version info:

uname -a:
Linux seagull 3.13.0-45-generic #74-Ubuntu SMP Tue Jan 13 19:36:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

npm -v
2.3.0

node -v
v0.11.14

node -p process.versions:
{ http_parser: '2.3',
node: '0.11.14',
v8: '3.26.33',
uv: '1.0.0',
zlib: '1.2.3',
modules: '14',
openssl: '1.0.1i' }

and the error message I get is:
node -e "console.warn(require('node-sass').info())"
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. (/home/damon/node_modules/node-sass/lib/index.js:211: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)

@am11
Copy link
Contributor

am11 commented Jan 27, 2015

@damonsmith, try with node v0.10.35 stable build.

@am11 am11 closed this as completed Jan 29, 2015
@damonsmith
Copy link

Hi, thanks for that, yes it works fine with 0.10.35 (and 0.10.25).

So if you try to load the module in the latest version of node it fails silently, reports no errors of any sort and is just not registered when you try to use it. Is it possible to get the module to log meaningful errors? Or is it a shortcoming of the node module loading system that it swallows errors?

@am11
Copy link
Contributor

am11 commented Jan 30, 2015

@damonsmith, each runtime version require rebuilding the binary. See #627 (comment). So we are only prebuilding binary for latest stable version of node.js v0.10.36 as of now. Node.js v0.11 branch is unstable. But you can manually build the binary, given you have tools install (in which case, refer to readme).

jiongle1 pushed a commit to scantist-ossops-m2/node-sass that referenced this issue Apr 7, 2024
Refactor C API for more robust ABI
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

6 participants