sjitech / build-nodejs-for-android

Build nodejs for android(arm,arm64,x86,x64,mipsel) perfectly and provide prebuilt binaries, and a docker image as workbench.
MIT License
108 stars 29 forks source link

npm and native module building? #6

Open dashxdr opened 6 years ago

dashxdr commented 6 years ago

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).

jjqq2013 commented 6 years ago

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 notifications@github.com:

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- .

dashxdr commented 6 years ago

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.

jjqq2013 commented 6 years ago

Yes, you are right, i forgot this point.

2018年3月9日(金) 7:33 Dave notifications@github.com:

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- .