Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package request: node-sass #1001

Closed
Rudloff opened this issue May 7, 2017 · 16 comments
Closed

Package request: node-sass #1001

Rudloff opened this issue May 7, 2017 · 16 comments
Labels
package request A new package was requested

Comments

@Rudloff
Copy link
Contributor

Rudloff commented May 7, 2017

Upstream refuses to support Android (sass/node-sass#1944) but maybe it can be patched on our end.

@fornwall fornwall added the package request A new package was requested label May 8, 2017
@akehir
Copy link

akehir commented May 29, 2017

Hi @Rudloff @fornwall, the issue why node-sass doesn't build on android is related to: #307 -> the compiler option in node-gyp / common.gypi is still fPIE (nodejs/node@271201f) and that produces a segfault. In order for build on android, node-sass needs to be compiled with fPIC.

I'm currently trying to see if I can follow the instructions here to provide a build for android.

@andrewcharnley
Copy link

Just hit this issue, if a fix is coming - fantastic!

@akehir
Copy link

akehir commented Jun 8, 2017

@andrewcharnley : I cannot promise how fast I can be.

Therefore, the fastest solution is to build node-sass yourself on android. Just follow the instructions I outlined here: http://blog.akehir.com/2017/05/building-node-sass-libsass-python.html

@andrewcharnley
Copy link

Followed that and it builds now, however upon usage I have the same message:-

android-arm-48/binding.node has text relocations.... segmentation fault

@akehir
Copy link

akehir commented Jun 15, 2017

Hi @andrewcharnley :

This indicates the flags have not been set correctly. What's your node --version?

I just followed the process, and currently it is 6.11.0 -> then the common.gypi in that specific directory needs to be edited (ie. nano ~/.node-gyp/6.11.0/include/node/common.gypi ).

If you edited the old 6.10.3 node directory, but did upgrade packages to install 6.11.0, then it won't work.

Furthermore, there are 2 configs in common.gypi: Debug, and Release. You need to edit both (or, at least the Release config, which is further down in the file) to use -fPIC as compiler option.

Once you've done that you can npm rebuild node-sass -f

@andrewcharnley
Copy link

I didn't look at common.gypi correctly and only edited the debug config. Working fine now. :)

@rscipher001
Copy link

I tried following same tutorial but there is not common.gypi file available anywhere, any ideas??
node is 6.11.3

@akehir
Copy link

akehir commented Sep 19, 2017

The file should be generated when you first try 'npm install node-sass'. It's located in your application user's home directory (cd ~/). The '~' will switch you to your app's home directory (in this case, the termux app - the full path would be something like /data/data/com.termux/home/).

Then, in your home directory, the '.node-gyp' directory would be a hidden directory (see the '.' before the name). So, just running 'ls' will not show the directory, you'd need something like 'ls -la'.

In any case, with node 6.11.3, the common.gypi would be under: ~/.node-gyp/6.11.3/include/node/common.gypi

@rscipher001
Copy link

Thanks, I switched to ruby sass compiler temporarily, now I can switch back to node.

@nstrelow
Copy link

Amazing, would love to see it working. Will check out the guide on building it.

@BlackMix
Copy link

BlackMix commented Jul 3, 2018

on android 7.1.2 cyanogenmod work fine.
u need install puthon2 and 3 + python2-dev and 3.

edit: I got some erros..

But I recommend using the stylus and stylus-loader
stylus does not need as much bullshit to work as sass haha

it is very similar to sass and I recommend it by
ease of use :)

@laosb
Copy link

laosb commented Sep 20, 2018

Any updates?

@ardyfeb
Copy link

ardyfeb commented Nov 14, 2018

on android 7.1.2 cyanogenmod work fine.
u need install puthon2 and 3 + python2-dev and 3.

edit: I got some erros..

But I recommend using the stylus and stylus-loader
stylus does not need as much bullshit to work as sass haha

it is very similar to sass and I recommend it by
ease of use :)

Move node sass to stylus not a solution

@daviddamilola
Copy link

ive tried following the steps above and in the linked blog, node sass installs succesfully but during build i get this error
"""
ERROR in ./src/sass/app.scss (./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/sass/app.scss)
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Error: dlopen failed: cannot locate symbol "__atomic_fetch_add_4" referenced by "/data/data/com.termux/files/home/davidBlogs/node_modules/node-sass/vendor/android-arm-79/binding.node"...
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1024:18)
at Module.load (internal/modules/cjs/loader.js:813:32)
at Function.Module._load (internal/modules/cjs/loader.js:725:14)
at Module.require (internal/modules/cjs/loader.js:850:19)
at require (internal/modules/cjs/helpers.js:74:18)
at module.exports (/data/data/com.termux/files/home/davidBlogs/node_modules/node-sass/lib/binding.js:19:10)
at Object. (/data/data/com.termux/files/home/davidBlogs/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (internal/modules/cjs/loader.js:958:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:994:10)
at Module.load (internal/modules/cjs/loader.js:813:32)
@ ./src/sass/app.scss 1:14-122 20:4-31:5 23:25-133
@ multi ./src/js/index.js ./src/sass/app.scss
Child html-webpack-plugin for "index.html":
1 asset
Entrypoint undefined = index.html
[./node_modules/html-webpack-plugin/lib/loader.js!./node_modules/html-webpack-template/index.ejs] 6.74 KiB {0} [built]
[./node_modules/lodash/lodash.js] 528
"""

@frink
Copy link

frink commented Dec 25, 2019

same thing here.

@vishalbiswas
Copy link
Contributor

Many upstream frameworks have moved to sass-loader and sass (from dart-sass) which works on Termux. We can close this issue now.

@ghost ghost closed this as completed Feb 18, 2021
@ghost ghost locked and limited conversation to collaborators Oct 9, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package request A new package was requested
Projects
None yet
Development

No branches or pull requests