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

node-sass builds binary even though it exists #1376

Closed
SeeThruHead opened this issue Feb 10, 2016 · 11 comments
Closed

node-sass builds binary even though it exists #1376

SeeThruHead opened this issue Feb 10, 2016 · 11 comments

Comments

@SeeThruHead
Copy link

I'm working with alpine linux with docker, i do not want python g++ and gcc cached into the ever changing layer that i use to install my node_modules

so what i'm doing is this:

  1. Installing python, gcc, g++
  2. npm install node-sass
  3. remove python, gcc, g++
  4. npm install
  5. node-sass build fails because the deps it needs to build aren't there anymore

is there any way to tell node-sass no to build on install? or look for an already build binary?

@SeeThruHead
Copy link
Author

That’s  not the issue in my case.
As you see I have a step that installs node-sass, which does download the binary, fails the check, and compiles from source.
The issue is that on the second npm install it goes ahead and does that all over again even though the working binary is already installed.

-- 
Shane Keulen
Sent with Airmail

On February 10, 2016 at 6:37:34 PM, Michael Mifsud (notifications@github.com) wrote:

A quick search of closed issue would have shown you that current
precompiled linux binaries do not work on alpine linux hence node-gyp is
need to compile the binding.

The npm installation error reports that the binary isn't compatible.
On Feb 11, 2016 5:17 AM, "Shane Keulen" notifications@github.com wrote:

I'm working with alpine linux, i do not want python g++ and gcc cached
into the ever changing layer that i use to install my node_modules

so what i'm doing is this:

  1. Installing python, gcc, g++
  2. npm install node-sass
  3. remove python, gcc, g++
  4. npm install
  5. node-sass build fails because the deps it needs to build aren't
    there anymore

is there any way to tell node-sass no to build on install? or look for an
already build binary?


Reply to this email directly or view it on GitHub
#1376.


Reply to this email directly or view it on GitHub.

@xzyfer
Copy link
Contributor

xzyfer commented Feb 10, 2016

Node Sass will not attempt to compile the binding if it alreday present. However since there is now way to know if the binary is present until the install happens node-gyp needs to be a dependency.

Maybe there is a way to make node-gyp not error prematurely. However you have not followed the contribution doc so we don't have any of the information required to potentially help you.

@xzyfer
Copy link
Contributor

xzyfer commented Feb 10, 2016

Apologies I realised that was not your issue and removed the comment.

@SeeThruHead
Copy link
Author

Yeah sorry about that, I will get back to you with the proper info.

@saper
Copy link
Member

saper commented Feb 14, 2016

Most Docker problems are coming from the fact that you are trying to do npm install as root. npm does not like it and it disables the use of our custom install/build scripts. Please try to do it as non-root user or use "unsafe" npm flags to let our install/build scripts run as specified in package.json.

@xzyfer
Copy link
Contributor

xzyfer commented Mar 19, 2016

Closing due to inactivity. Please open a new issue with the exact steps required to reproduce the problem.

@kop
Copy link

kop commented Apr 21, 2016

I have a very similar issue.
I'm building a Docker image for an app that is using node-sass based on Alpine Linux.

In order to speed up builds, I'm installing node-sass globally first, to cache it in the Docker layer.
After that, I'm copying my code to the container and running npm install to install node-sass locally.
And during install, it says that binding is found, but the check is not passed, so it rebuilds binding again.

@xzyfer
Copy link
Contributor

xzyfer commented Apr 21, 2016

@kop if you try with node-sass@v3.5 it should produce the error the check ran into.

@kop
Copy link

kop commented Apr 21, 2016

@xzyfer,

Here is what I have during global build:

> node-sass@3.5.2 install /usr/lib/node_modules/node-sass
> node scripts/install.js

Binary downloaded and installed at /usr/lib/node_modules/node-sass/vendor/linux-x64-47/binding.node

> node-sass@3.5.2 postinstall /usr/lib/node_modules/node-sass
> node scripts/build.js

"/usr/lib/node_modules/node-sass/vendor/linux-x64-47/binding.node" exists. 
 testing binary.
Problem with the binary:
Error: Error relocating /usr/lib/node_modules/node-sass/vendor/linux-x64-47/binding.node: __strtod_internal: symbol not found
Manual build incoming.
Building: /usr/bin/node /usr/lib/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=

And this from local one:

> node-sass@3.5.2 install /srv/fae/node_modules/node-sass
> node scripts/install.js

Binary downloaded and installed at /srv/fae/node_modules/node-sass/vendor/linux-x64-47/binding.node

> node-sass@3.5.2 postinstall /srv/fae/node_modules/node-sass
> node scripts/build.js

"/srv/fae/node_modules/node-sass/vendor/linux-x64-47/binding.node" exists. 
 testing binary.
Problem with the binary:
Error: Error relocating /srv/fae/node_modules/node-sass/vendor/linux-x64-47/binding.node: __strtod_internal: symbol not found
Manual build incoming.
Building: /usr/bin/node /srv/fae/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=

@xzyfer
Copy link
Contributor

xzyfer commented Apr 21, 2016

It appears that Alpine Linux doesn't have the correct symbols. Essentially our precompiled binaries are not compatible with Alpine Linux. As previously stated this has come up before, and as yet we don't have an offical solution.

@xzyfer
Copy link
Contributor

xzyfer commented Jun 18, 2016

We're working on Alpine Linux support in #1589 and could use your help!

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

4 participants