1

I'm running raspbian on my pi, and when I run "npm rebuild" to get my npm-installed node-red node packages appearing on my node-red interface. When I run "npm rebuild" it goes into a never ending makefile to try and build from source (or at least it lasted for over an hour with no apparent progress):

 sqlite3@4.0.9 install /home/pi/.node-red/node_modules/sqlite3

 node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 

node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.0.9/node-v57-linux-arm.tar.gz 

node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.0.9 and node@8.11.4 (node-v57 ABI, glibc) (falling back to source compile with node-gyp)

make: Entering directory '/home/pi/.node-red/node_modules/sqlite3/build'
  ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep 

Release/obj/gen/sqlite-autoconf-3280000/sqlite3.c

  TOUCH Release/obj.target/deps/action_before_build.stamp
  CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3280000/sqlite3.o

^Cdeps/sqlite3.target.mk:123: recipe for target 

'Release/obj.target/sqlite3/gen/sqlite-autoconf-3280000/sqlite3.o' failed

make: *** [Release/obj.target/sqlite3/gen/sqlite-autoconf-3280000/sqlite3.o] Interrupt

In short, I can't use the contrib-nodes because sqlite won't load--and it's the ideal solution for my problem.

When I run "sudo npm rebuild" I'm faced with errors:

 sqlite3@4.0.9 install /home/pi/.node-red/node_modules/sqlite3

 node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 

node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.0.9/node-v72-linux-arm.tar.gz 

node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.0.9 and node@12.4.0 (node-v72 ABI, glibc) (falling back to source compile with node-gyp) 

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/12.4.0"

gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/pi/.node-red/node_modules/sqlite3/.node-gyp"

make: Entering directory '/home/pi/.node-red/node_modules/sqlite3/build'

make: *** No rule to make target '../.node-gyp/12.4.0/include/node/common.gypi', needed by 'Makefile'.  Stop.

make: Leaving directory '/home/pi/.node-red/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/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)

gyp ERR! stack     at ChildProcess.emit (events.js:200:13)

gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)

gyp ERR! System Linux 4.19.42-v7+

gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" 
"build" "--fallback-to-build" "--module=/home/pi/.node-

red/node_modules/sqlite3/lib/binding/node-v72-linux-arm/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/home/pi/.node-red/node_modules/sqlite3/lib/binding/node-v72-linux-arm" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"

gyp ERR! cwd /home/pi/.node-red/node_modules/sqlite3

gyp ERR! node -v v12.4.0

gyp ERR! node-gyp -v v3.8.0

gyp ERR! not ok 

node-pre-gyp ERR! build error 

node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js 

build --fallback-to-build --module=/home/pi/.node-red/node_modules/sqlite3/lib/binding/node-v72-linux-arm/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/pi/.node-red/node_modules/sqlite3/lib/binding/node-v72-linux-arm --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)

node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/pi/.node-red/node_modules/node-pre-gyp/lib/util/compile.js:83:29)

node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:200:13)

node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)

node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

node-pre-gyp ERR! System Linux 4.19.42-v7+

node-pre-gyp ERR! command "/usr/local/bin/node" "/home/pi/.node-red/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"

node-pre-gyp ERR! cwd /home/pi/.node-red/node_modules/sqlite3

node-pre-gyp ERR! node -v v12.4.0

node-pre-gyp ERR! node-pre-gyp -v v0.11.0

node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/pi/.node-red/node_modules/sqlite3/lib/binding/node-v72-linux-arm/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/pi/.node-red/node_modules/sqlite3/lib/binding/node-v72-linux-arm --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! sqlite3@4.0.9 install: `node-pre-gyp install --fallback-to-build`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the sqlite3@4.0.9 install script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

npm ERR!     /root/.npm/_logs/2019-06-15T23_16_13_885Z-debug.log

If it helps, I'll attach the debug log in a future comment.

I've tried following the advice here: bcrypt@1.0.3 install: `node-pre-gyp install --fallback-to-build`

and here: Error with npm-gyp during npm rebuild

In both cases this meant following all the advice including finding the right python version and trying to route commands through python frameworks (trying to run npm in python)

As well as logging into aws to to try and download build binaries 4.0.9, I've also used nvm to install node v10.16.0, v8.16.0, and v12.4.0 and have run "npm rebuild" on all three frameworks to near identical output

I expect "npm rebuild" to allow me to use the sql node, and the telegrambot node so I can get some basic flows going through it for my demo coming up.

hardillb
  • 54,545
  • 11
  • 67
  • 105
DeciJ
  • 21
  • 7
  • Deleting node-gyp and then doing ```npm install``` then doing ```npm rebuild``` in the ```~/.node-red``` directory produced the same problem. – DeciJ Jun 16 '19 at 01:30
  • It may have something to do with how node-gyp tries to do things as a "nobody user" as per ```https://nodered.org/docs/getting-started/upgrading.html``` but I don't know how to extend "--unsafe-perm" across the entire update process. – DeciJ Jun 16 '19 at 16:29
  • You souldn't be using sudo to do anything with nodes in `~/.node-red` ever, it screws the permissions up. – hardillb Jun 16 '19 at 23:02
  • Thanks, I'll keep it in mind. – DeciJ Jun 16 '19 at 23:24
  • I finally decided to use mongodb. I've used the commands at the following link to handle IDE updates. https://nodered.org/docs/hardware/raspberrypi – DeciJ Jun 17 '19 at 16:36

0 Answers0