0

I am trying to install node package 'sqlite3' on linux based arm processor. I get error when I try to install the package. However if I try installing the same package on ubuntu, it goes through.

I am using Linux Kernel 3.14.52-v2.6b2+g7c83cef on the arm processor.

The command I use for sqlite3 installation is npm install sqlite3. I did try this link but of no use.

I get a different error

root@colibri-imx6:~# npm install sqlite3
-\|-\
> sqlite3@3.1.8 install /home/root/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(undefined): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.8/node-v14-linux-arm.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.8 and node@0.12.7 (node-v14 ABI) (falling back to source compile with node-gyp 
make: Entering directory '/home/root/node_modules/sqlite3/build'
  ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3150000/sqlite3.c
  TOUCH Release/obj.target/deps/action_before_build.stamp
  CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o
make: cc: Command not found
    deps/sqlite3.target.mk:117: recipe for target 'Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o' failed
make: *** [Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o] Error 127
make: Leaving directory '/home/root/node_modules/sqlite3/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.14.52-v2.6b2+g7c83cef
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/h"
gyp ERR! cwd /home/root/node_modules/sqlite3
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallb)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/root/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
node-pre-gyp ERR! stack     at maybeClose (child_process.js:1015:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
node-pre-gyp ERR! System Linux 3.14.52-v2.6b2+g7c83cef
node-pre-gyp ERR! command "node" "/home/root/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/root/node_modules/sqlite3
node-pre-gyp ERR! node -v v0.12.7
node-pre-gyp ERR! node-pre-gyp -v v0.6.31
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/roo)
npm ERR! Linux 3.14.52-v2.6b2+g7c83cef
npm ERR! argv "node" "/usr/bin/npm" "install" "sqlite3"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE

npm ERR! sqlite3@3.1.8 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sqlite3@3.1.8 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! This is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR!     npm owner ls sqlite3
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/root/npm-debug.log
root@colibri-imx6:~# 

I installed python-compiler, python-modules, and now gcc to take care of cc command but nothing is working. Has anyone encountered this problem ?

Community
  • 1
  • 1
OnkarM
  • 1
  • 1

3 Answers3

0

It may be because your arm based processor don't have a C compiler (usually gcc for linux) bundled with the OS...

The debug log tells that the packages fails on compiling native sources.

I can't tell you this is the cause for sure but you should give a try on that way !

Gramatiik
  • 122
  • 1
  • 11
0

I installed node sqlite3 on ubuntu arm64 successfully with

sudo apt install python

That’s because node-sqlite3 need python2 to compile. Ubuntu use python3 by default.

Gllm
  • 11
  • 3
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/31396437) – जलजनक Mar 30 '22 at 16:36
0

I had a similar issue where I was unable to install sqlite3 via npm on a raspberry pi 3, which relies on ARM.

As I understand it, npm is unable to select the correct binary for sqlite3 in ARM, so the install fails. I (and many others) found that deleting nodes_modules folder and running the following commands worked - see the relevant issue thread from node-sqlite3

sudo apt-get install libsqlite3-dev
npm install sqlite3 --build-from-source --sqlite=/usr

This worked for rasbian bullseye which is based on debian.