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

Problem with Node wrapper and "sassBinaryName" #691

Closed
bumxu opened this issue Feb 20, 2015 · 2 comments
Closed

Problem with Node wrapper and "sassBinaryName" #691

bumxu opened this issue Feb 20, 2015 · 2 comments

Comments

@bumxu
Copy link

bumxu commented Feb 20, 2015

When node-sass is installed with npm install node-sass or as dependency by another npm installation, binary binding is enclosed in a "OS-ARCH-node-VERSION" folder.

image

Now, if app is launched with a node wrapper which process.execPath is not the node path, for example LiveScript (execPath = C:\Users\UserName\AppData\Roaming\npm\node_modules\LiveScript\bin\lsc) import fails with Error: libsass bindings not found because it search for "OS-ARCH-lsc-VERSION" folder.

Should the binding name be dependent on the execPath mandatory?

Thanks :)

@am11
Copy link
Contributor

am11 commented Feb 20, 2015

Thanks for brining this to attention. I considered many angles to avoid version sniffing but missed this one.

The real solution will come with the approach which will be finalised by: nodejs/node-gyp#564 (and used by nodejs/node-gyp#564).

Workaround:

So the standard "hacky" (version sniffing) approach is to add the following before node-sass (v2.0.1)/lib/extensions.js#L11:

return runtimeVersion.major < 1 ? 'node' : 'iojs';

Note this^ workaround only applies to node-sass v2.0.1 (and its predecessor v2.0.0). With vNext we will replace it with a better alternative available at time.

Note 2 with ref to #655; this approach is not feasible because it fails to detect atom-shell runtime. Also, it is not clear at this point whether or not we will be releasing binaries for atom-shell.

@am11 am11 added this to the 2.1 milestone Feb 23, 2015
@am11
Copy link
Contributor

am11 commented Feb 23, 2015

This issue is addressed by #695.

@am11 am11 closed this as completed Feb 23, 2015
jiongle1 pushed a commit to scantist-ossops-m2/node-sass that referenced this issue Apr 7, 2024
Improve custom importer to pass parent import context
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

2 participants