build-nodejs-for-android icon indicating copy to clipboard operation
build-nodejs-for-android copied to clipboard

npm and native module building?

Open dashxdr opened this issue 6 years ago • 3 comments

Is it possible to install npm modules like termios? https://github.com/Gottox/node-termios

It is a binary that gets loaded with the dlopen machinery... which seems to require lots of shared libraries (which android doesn't have).

dashxdr avatar Mar 07 '18 05:03 dashxdr

It is possible to run npm. You can check it in readme: Run npm(NodeJS Package Manager)

Use following script as npm, then you can use npm install, -g also allowed.

export HOME=/data/local/tmp export NODE_REPL_HISTORY=$HOME/node_history mkdir $HOME/npm-global 2> /dev/null export NPM_CONFIG_PREFIX=$HOME/npm-global $HOME/node $HOME/lib/node_modules/npm/bin/np

But i have not test termios.

2018年3月7日(水) 14:41 Dave [email protected]:

Is it possible to install npm modules like termios? https://github.com/Gottox/node-termios

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sjitech/build-nodejs-for-android/issues/6, or mute the thread https://github.com/notifications/unsubscribe-auth/AE_djBVef-n1UF2YIX9Orhs8CvKoIaOoks5tb3MGgaJpZM4Sf5L- .

jjqq2013 avatar Mar 07 '18 08:03 jjqq2013

I think npm would only work to install native js modules, anything that requires c++ compilation to binary wouldn't have a chance of working. The infrastructure for compiling just isn't there under android.

dashxdr avatar Mar 08 '18 22:03 dashxdr

Yes, you are right, i forgot this point.

2018年3月9日(金) 7:33 Dave [email protected]:

I think npm would only work to install native js modules, anything that requires c++ compilation to binary wouldn't have a chance of working. The infrastructure for compiling just isn't there under android.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/sjitech/build-nodejs-for-android/issues/6#issuecomment-371648155, or mute the thread https://github.com/notifications/unsubscribe-auth/AE_djAI7-OS9ZNMavfT4SkLyMWlaq3jmks5tcbHUgaJpZM4Sf5L- .

jjqq2013 avatar Mar 09 '18 00:03 jjqq2013