Hi,
npm tell me to report you this bug, here is the log file, but it's very long, maybe you prefer only just the error:
Error: Error relocating /home/project/project-front/node_modules/gulp-sass/node_modules/node-sass/vendor/linux-x64-node-0.10/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> (/home/project/project-front/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:188: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)
OS: alpine linux
kernel: Linux 3.14.36-0-grsec
npm: 2.7.3
nodejs: v0.10.33
Hi, please make a gist showing the output of these commands: https://gist.github.com/am11/9f429c211822a9b15aee
@am11 here it is
thanks
@WnP thanks.
We build Linux binaries using CentOS. It seems like the binary is not compatible with Alpine Linux.
Just for reconfirming, could you repeat those steps with npm install node-sass@alpha? It should install v3.0.0-alpha.0. Again the alpha binaries are also built with CentOS.
@am11 one more
does it mean it works?
by the way, alpine use musl not glibc, maybe it's a problem for pre-build binary
Thanks.
does it mean it works?
Nope.
We first download the prebuild binary per the node.js version and platform type. If it fails, the script tries to build the binary from source.
In v2.0.1, the manual build (fallback) was broken. But the fallback mechanism is not the ideal because it requires you to have gcc, g++ (v4.7) and python 2.6 (or 2.7) installed on your system. In your case fallback is not working for this very reason.
Currently, our binaries are compatible with CentOS 5.11+ and Ubuntu 12.0.4 (and some Fedoras). At least this is what I have conformed.
Ok, tested with archlinux and works perfectly, will test tomorow (I'm too sleepy right now, sorry) for alpine's build dependency
Thanks
2.7.4
v0.12.1
{ http_parser: '2.3',
node: '0.12.1',
v8: '3.28.73',
uv: '1.0.2',
zlib: '1.2.8',
modules: '14',
openssl: '1.0.1m' }
linux
x64
|
[email protected] install /root/temp1/node_modules/node-sass
node scripts/install.js
module.js:338
throw err;
^
Error: Cannot find module '/root/temp1/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 2.6.32-358.6.2.el6.x86_64
npm ERR! argv "node" "/usr/local/bin/npm" "install" "node-sass"
npm ERR! node v0.12.1
npm ERR! npm v2.7.4
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node scripts/install.js
npm ERR! Exit status 1
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! /root/temp1/npm-debug.log
test.sh: line 15: ./node_modules/.bin/node-sass: No such file or directory
module.js:338
throw err;
^
Error: Cannot find module 'node-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 [eval]:1:13
at Object.exports.runInThisContext (vm.js:74:17)
at Object.
at Module._compile (module.js:460:26)
at evalScript (node.js:431:25)
at startup (node.js:90:7)
module.js:338
throw err;
^
Error: Cannot find module 'node-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 [eval]:1:13
at Object.exports.runInThisContext (vm.js:74:17)
at Object.
at Module._compile (module.js:460:26)
at evalScript (node.js:431:25)
at startup (node.js:90:7)
test.sh: line 22: cd: node_modules/node-sass/vendor: No such file or directory
module.js:338
throw err;
^
Error: Cannot find module 'node-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 [eval]:1:13
at Object.exports.runInThisContext (vm.js:74:17)
at Object.
at Module._compile (module.js:460:26)
at evalScript (node.js:431:25)
at startup (node.js:90:7)
@am11 after installing gcc 4.8.3, g++ 4.8.3, make 4.1 and Python 2.7.9, alpha release build as expected, hope the fallback mechanism will be merge in stable :-)
v2.1.1 stable is released with the fix. :)
Oh great! You rocks @am11 ;)
node-sass 2.1.1 still fails to install under Alpine Linux:
> [email protected] postinstall /node_modules/node-sass
> node scripts/build.js
`linux-x64-iojs-1.6` exists; testing
module.js:335
Module._extensions[extension](this, filename);
^
Error: Error relocating /node_modules/node-sass/vendor/linux-x64-iojs-1.6/binding.node: __strtod_internal: symbol not found
@pikeas,
Alpine nix is using UCibc, while our Linux binaries target glibc (which majority distros are using).
Since this is not feasible for us to build binaries for all possible flavors C-runtimes used in varied Linux distributions (in other words, become a sole binary package manager for libsass), unfortunately the only option you have is to manual compilation on install:
SKIP_SASS_BINARY_DOWNLOAD_FOR_CI=true npm install node-sass@beta
# or separately export it before installation:
# export SKIP_SASS_BINARY_DOWNLOAD_FOR_CI=true
[deleted text]
I'm sorry. My mistake. node-sass works fine with Alpine Linux!
We don't officially support Alpine Linux.
Although we support more traditional Linux distributions (i.e. Ubuntu and
CentOS) Alpine is different enough that it would require a separate binary
to be built.
This is something we're happy to do with help from the community, but not
something we have time to actively pursue at the moment.
On 7 Jun 2015 05:42, "Vlad Frolov" [email protected] wrote:
@am11 https://github.com/am11 It still fails :(
SKIP_SASS_BINARY_DOWNLOAD_FOR_CI=true npm install node-sass@beta
\
[email protected] install /mnt/node_modules/node-sass
node scripts/install.jsSkipping downloading binaries on CI builds
[email protected] postinstall /mnt/node_modules/node-sass
node scripts/build.jsBuilding: /usr/bin/node node_modules/pangyp/bin/node-gyp rebuild --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
module.js:340
throw err;
^
Error: Cannot find module '/mnt/node_modules/node-sass/node_modules/pangyp/bin/node-gyp'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:935:3
Build failed
npm ERR! Linux 4.0.4-2-ARCH
npm ERR! argv "node" "/usr/bin/npm" "install" "node-sass@beta"
npm ERR! node v0.10.38
npm ERR! npm v2.11.0
npm ERR! code ELIFECYCLEnpm ERR! [email protected] postinstall:
node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node scripts/build.js'.Without SPIP_SASS_BINRAY_DOWNLOAD_FOR_CI=true it fails with the following
error:Error: Error relocating /usr/lib/node_modules/este-todomvc/node_modules/sass-loader/node_modules/node-sass/vendor/linux-x64-node-0.10/binding.node: __strtod_internal: symbol not found
BTW, Alpine uses musl libc, not UClibc since April 2014.
โ
Reply to this email directly or view it on GitHub
https://github.com/sass/node-sass/issues/808#issuecomment-109730136.
@xzyfer I'm sorry for that. node-sass works on Alpine Linux! I had some garbage in my node_modules folder, which was the cause of the error.
Unlike prior versions, the recent releases of Apline use libc. What libsass binary doesn't supported is micro-Clib runtime, which some Linux distributions still consume.
I run into the same issue. Here is the output.
> node scripts/build.js
`darwin-x64-node-0.12` exists; testing
module.js:355
Module._extensions[extension](this, filename);
^
Error: dlopen(/Users/markli/dev/napos/gulp-workflow/node_modules/node-sass/vendor/darwin-x64-node-0.12/binding.node, 1): no suitable image found. Did find:
/Users/markli/dev/napos/gulp-workflow/node_modules/node-sass/vendor/darwin-x64-node-0.12/binding.node: truncated mach-o error: segment __TEXT extends to 864256 which is past end of file 818459
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/markli/dev/napos/gulp-workflow/node_modules/node-sass/lib/index.js:188: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 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "link"
npm ERR! node v0.12.9
npm ERR! npm v2.14.9
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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.
Please follow the steps in the troubleshooting guide.
You're also running a very old version of node-sass. Please update.
On Feb 25, 2016 7:12 PM, "li.li" [email protected] wrote:
I run into the same issue. Here is the output.
node scripts/build.js
darwin-x64-node-0.12exists; testing
module.js:355
Module._extensionsextension;
^
Error: dlopen(/Users/markli/dev/napos/gulp-workflow/node_modules/node-sass/vendor/darwin-x64-node-0.12/binding.node, 1): no suitable image found. Did find:
/Users/markli/dev/napos/gulp-workflow/node_modules/node-sass/vendor/darwin-x64-node-0.12/binding.node: truncated mach-o error: segment __TEXT extends to 864256 which is past end of file 818459
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/markli/dev/napos/gulp-workflow/node_modules/node-sass/lib/index.js:188: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 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "link"
npm ERR! node v0.12.9
npm ERR! npm v2.14.9
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall:node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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.I just run into this issue when I use npm link . It works well with npm
install . -gโ
Reply to this email directly or view it on GitHub
https://github.com/sass/node-sass/issues/808#issuecomment-188664893.
Do anyone have any updates on installing node-sass on alpine? Or is everyone installing node-sass@beta setting SKIP_SASS_BINARY_DOWNLOAD_FOR_CI? For my case, it breaks other packages which are not ready for sass 3.5+. Example [email protected] wants node-sass@^3.4.2.
Using npm install on version 3.4 gives errors as well, even with the mentionend environment variable sat.
Do anyone have any updates on installing node-sass on alpine?
We still do not officially support Alpine Linux.
Or is everyone installing node-sass@beta
There no beta any more, just install node-sass
setting SKIP_SASS_BINARY_DOWNLOAD_FOR_CI
This should not be required. If binary fails to load on install (which it will on Alpine) it'll be compiled locally.
it breaks other packages which are not ready for sass 3.5+. Example [email protected] wants node-sass@^3.4.2.
It appears that you misunderstand semver - ^3.4.2 means greater or equal to 3.4.2 and less than 4.0.0. That means 3.5.0 will work fine.
Using npm install on version 3.4 gives errors as well, even with the mentionend environment variable sat.
Without at the very least providing these errors I don't know what you expect from us.
Strange.. I had a lot of trouble getting this to work yesterday. There must have been an old version of the npm cache (or something) that bit me, this worked perfectly today!
I also though semver acted that way, but the @beta did work, ^3.4.2 did not. I must have overlooked something...
Lots of output truncated
localhost { ~ }$ docker run -it --rm alpine:3.3 sh
/ # apk update
/ # apk add nodejs python make g++
/ # npm install node-sass sass-loader
/ # npm list node-sass sass-loader
/
โโโ [email protected]
โโโ [email protected]
Everything is good! Thanks!
@am11 we're using Alpine Linux too... and it's very painful on our CI to see node-sass compiled every time & taking so much time (btw it works perfectly under Alpine Linux).
Is the node-sass distribution process automated? How (which tool) do you use to compile it under CentOS?
Would be super cool to produce an Alpine Linux compatible binary too, I can make a PR if you want.
BTW I've seen https://github.com/sass/node-sass/issues/56 but still unclear to me how do you proceed today for artifacts distribution.
@shouze, our binary building is party automated. For Windows, all bins are built on AppVeyor CI, then we download the artifacts and upload them as release assets manually. For Linux, we build on CentOS for maximum compatibility. At some point we were using this Docker script https://gist.github.com/am11/1529b2458b1a1f4bdba8 which produces all variants of binaries (arch x node.js module versions). We can potentially compile against musl by having a similar docker recipe.
Furthermore, it would also require some alteration in our binary naming convention to disambiguate varied C-runtimes: https://github.com/sass/node-sass/blob/a04e84d/lib/extensions.js#L171. For instance, something to let both linux-ia32-44_binding.node and linux-musl-ia32-44_binding.node co-exist. At runtime or during the installation, we can detect it by checking whether the output of require('os').release() contains "musl" or "alpine".
Ok, thx @am11! So it would require 2 dedicated Dockerfiles to automate on Linux libc variants. I can take inspiration from the one for centOS in the gist.
Most helpful comment
Strange.. I had a lot of trouble getting this to work yesterday. There must have been an old version of the npm cache (or something) that bit me, this worked perfectly today!
I also though semver acted that way, but the
@betadid work,^3.4.2did not. I must have overlooked something...Lots of output truncated
Everything is good! Thanks!