Error log for install of Node Sqlite on Android

I have tried to install Sqlite from the pallette and manually with the npm i --unsafe-perm node-red-node-sqlite command into Android via Termux.

Here are the logs. Can anyone assist me in understanding the issue. I am really at a loss how to install this.

I had to truncate the logs. They were quite large but the error "error code ELIFECYCLE" seems to popping up every time I try to load this or other sqlite3 options.

2813 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
2814 verbose pkgid sqlite3@4.1.1
2815 verbose cwd /data/data/com.termux/files/home
2816 verbose Linux 3.18.120-perf-gd91300b
2817 verbose argv "/data/data/com.termux/files/usr/bin/node" "/data/data/com.termux/files/usr/bin/npm" "i" "--unsafe-perm" "node-red-node-sqlite"
2818 verbose node v13.0.0
2819 verbose npm  v6.12.0
2820 error code ELIFECYCLE
2821 error errno 1
2822 error sqlite3@4.1.1 install: `node-pre-gyp install --fallback-to-build`
2822 error Exit status 1
2823 error Failed at the sqlite3@4.1.1 install script.
2823 error This is probably not a problem with npm. There is likely additional logging output above.
2824 verbose exit [ 1, true ]

And the second one



2721 verbose argv "/data/data/com.termux/files/usr/bin/node" "/data/data/com.termux/files/usr/bin/npm" "install" "--no-audit" "--no-update-notifier" "--save" "--save-prefix=\"~\"" "--production" "node-red-node-sqlite@0.4.2"
2722 verbose node v13.0.0
2723 verbose npm  v6.12.0
2724 error code ELIFECYCLE
2725 error errno 1
2726 error sqlite3@4.1.1 install: `node-pre-gyp install --fallback-to-build`
2726 error Exit status 1
2727 error Failed at the sqlite3@4.1.1 install script.
2727 error This is probably not a problem with npm. There is likely additional logging output above.
2728 verbose exit [ 1, true ]

installing sqlite will need to recompile some modules locally on the device. If the build tools for those are not installed it won't install - not tried on termux - but do they have a "build-essential" package ? if not it will be a bit of a slog to work out what is missing and how and if it would work on termux.

Dceeyjay. Thank you for the quick response. I have found this:

There no universal guide about building/porting packages in Termux, especially since Termux isn't a standard platform.

Though you can follow some recommendations mentioned here:

  1. Make sure that minimal set of build tools is installed:

pkg install build-essential

  1. After extracting package source code, check for files named like "README" or "INSTALL". They usually contain information about how to build a package.

  2. Autotools based projects (have ./configure script in project's root) in most cases can be built with the following commands:

./configure --prefix=$PREFIX
make && make install

ref: https://wiki.termux.com/wiki/Building_packages

Am I on the right track? Do you know of a how to link that I can read. It is getting late where I am and I will be able to try again tomorrow.

Have you tried installing build-essential and then trying the node install again?

Okay, I have installed build-essential and then actually added the Sqlite files into a folder in the /data/data/com.termux/files/home/.node-red/node_modules/sqlite path.

I have also left the zip file in the /data/data/com.termux/files/home/.node-red/node_modules path.

I see that Sqlite folder has permissions of drwxr-xr-x and the zip file has extension/permission of -rwxrwxrwx. The other folders in the node_modules folder have -drwx permissions

SU is granted to Termux.

I am now trying to research what these permissions do in Node Red. I came to this conclusion as I found an 'access is denied' error in a log on an install attempt.

I have tried the command "SU" in Termux and then tried to run NPM commands but it returns "Not Found".

Anyone with suggestions? I'm happy to try anything. I really am just fumbling through this. I am not worried about security at this stage. This phone is old and has no SIM or personal data and never will.

Update: Trying to install Sqlite again and I now get this permission error:

1812 silly saveTree       └── uuid@3.4.0
1813 warn node-red-contrib-ui-led@0.3.1 requires a peer of node-red-dashboard@2.14.x but none is installed. You must install peer dependencies yourself.
1814 verbose stack Error: EACCES: permission denied, unlink '/data/data/com.termux/files/home/.node-red/node_modules/.node-red-node-sqlite.DELETE/ext/half.c'
1815 verbose cwd /data/data/com.termux/files/home/.node-red
1816 verbose Linux 3.18.120-perf-gd91300b
1817 verbose argv "/data/data/com.termux/files/usr/bin/node" "/data/data/com.termux/files/usr/bin/npm" "install" "--no-audit" "--no-update-notifier" "--save" "--save-prefix=\"~\"" "--production" "node-red-node-sqlite@0.4.2"
1818 verbose node v13.0.0
1819 verbose npm  v6.12.0
1820 error code EACCES
1821 error syscall unlink
1822 error path /data/data/com.termux/files/home/.node-red/node_modules/.node-red-node-sqlite.DELETE/ext/half.c
1823 error errno -13
1824 error Error: EACCES: permission denied, unlink '/data/data/com.termux/files/home/.node-red/node_modules/.node-red-node-sqlite.DELETE/ext/half.c'
1824 error  [OperationalError: EACCES: permission denied, unlink '/data/data/com.termux/files/home/.node-red/node_modules/.node-red-node-sqlite.DELETE/ext/half.c'] {
1824 error   cause: [Error: EACCES: permission denied, unlink '/data/data/com.termux/files/home/.node-red/node_modules/.node-red-node-sqlite.DELETE/ext/half.c'] {
1824 error     errno: -13,
1824 error     code: 'EACCES',
1824 error     syscall: 'unlink',
1824 error     path: '/data/data/com.termux/files/home/.node-red/node_modules/.node-red-node-sqlite.DELETE/ext/half.c'
1824 error   },
1824 error   stack: "Error: EACCES: permission denied, unlink '/data/data/com.termux/files/home/.node-red/node_modules/.node-red-node-sqlite.DELETE/ext/half.c'",
1824 error   errno: -13,
1824 error   code: 'EACCES',
1824 error   syscall: 'unlink',
1824 error   path: '/data/data/com.termux/files/home/.node-red/node_modules/.node-red-node-sqlite.DELETE/ext/half.c',
1824 error   parent: '.node-red'
1824 error }
1825 error The operation was rejected by your operating system.
1825 error It is likely you do not have the permissions to access this file as the current user
1825 error
1825 error If you believe this might be a permissions issue, please double-check the
1825 error permissions of the file and its containing directories, or try running
1825 error the command again as root/Administrator.
1826 verbose exit [ -13, true ]

Okay, I am now looking at SU and I am using Magisk for SU. It offers me a few options.

1. Multiuser mode:
a. Device Owner Only
b. Device Owner Managed
c. User Independent

2. Mount Namespace Mode
a. Global Namespace
b. Inherit Namespace
c. Isolated Namespace

Any ideas if this might be related to the issue. What settings do you suggest?

I am still confused why I am getting a permission error when I try to add the node in the pallette manager, but still get the initial log error when I try to install manually.

I got this working finally. I originally used Magisk for SU and after that wasn't working I attempted to use Firechain's SuperSu which also was not suitable.

After reinstalling Termux and Build Essential, Node Red and Magisk thing still were not working. I found that by installing the sqlite3 package with sudo seemed to work but I can't be 100% sure that was the reason.

Thank for the help. It was a steep learning curve.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.