damoclark / node-red-contrib-msg-queue

A contributed Node-RED node, that queues undeliverable messages to file for later delivery.
GNU General Public License v3.0
10 stars 17 forks source link

Installation error on node-red for Docker #15

Closed elyancorrea closed 1 year ago

elyancorrea commented 1 year ago

I was trying from manage pallete and directly on bash terminal.

npm install node-red-contrib-msg-queue

Error message:

npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs npm WARN deprecated node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future npm ERR! code 1 npm ERR! path /usr/src/node-red/node_modules/node-persistent-queue/node_modules/sqlite3 npm ERR! command failed npm ERR! command sh -c node-pre-gyp install --fallback-to-build npm ERR! make: Entering directory '/usr/src/node-red/node_modules/node-persistent-queue/node_modules/sqlite3/build' npm ERR! ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3310100/sqlite3.c npm ERR! make: Leaving directory '/usr/src/node-red/node_modules/node-persistent-queue/node_modules/sqlite3/build' npm ERR! 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=/usr/src/node-red/node_modules/node-persistent-queue/node_modules/sqlite3/lib/binding/node-v93-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/usr/src/node-red/node_modules/node-persistent-queue/node_modules/sqlite3/lib/binding/node-v93-linux-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1) npm ERR! node-pre-gyp info it worked if it ends with ok npm ERR! node-pre-gyp info using node-pre-gyp@1.0.10 npm ERR! node-pre-gyp info using node@16.16.0 | linux | x64 npm ERR! node-pre-gyp info check checked for "/usr/src/node-red/node_modules/node-persistent-queue/node_modules/sqlite3/lib/binding/node-v93-linux-x64/node_sqlite3.node" (not found) npm ERR! node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v93-linux-x64.tar.gz npm ERR! node-pre-gyp ERR! install response status 403 Forbidden on https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v93-linux-x64.tar.gz npm ERR! node-pre-gyp WARN Pre-built binaries not installable for sqlite3@4.2.0 and node@16.16.0 (node-v93 ABI, musl) (falling back to source compile with node-gyp) npm ERR! node-pre-gyp WARN Hit error response status 403 Forbidden on https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v93-linux-x64.tar.gz npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.0.0 npm ERR! gyp info using node@16.16.0 | linux | x64 npm ERR! gyp info ok npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.0.0 npm ERR! gyp info using node@16.16.0 | linux | x64 npm ERR! gyp info find Python using Python version 3.10.5 found at "/usr/bin/python3" npm ERR! gyp WARN EACCES current user ("node-red") does not have permission to access the dev dir "/root/.cache/node-gyp/16.16.0" npm ERR! gyp WARN EACCES attempting to reinstall using temporary dev dir "/tmp/.node-gyp" npm ERR! gyp info spawn /usr/bin/python3 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'make', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/usr/src/node-red/node_modules/node-persistent-queue/node_modules/sqlite3/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/tmp/.node-gyp/16.16.0/include/node/common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=/tmp/.node-gyp/16.16.0', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/tmp/.node-gyp/16.16.0/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/usr/src/node-red/node_modules/node-persistent-queue/node_modules/sqlite3', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! gyp info ok npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.0.0 npm ERR! gyp info using node@16.16.0 | linux | x64 npm ERR! gyp info spawn make npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] npm ERR! /bin/sh: python: not found npm ERR! make: *** [deps/action_before_build.target.mk:13: Release/obj/gen/sqlite-autoconf-3310100/sqlite3.c] Error 127 npm ERR! gyp ERR! build error npm ERR! gyp ERR! stack Error:makefailed with exit code: 2 npm ERR! gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:527:28) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) npm ERR! gyp ERR! System Linux 5.15.90.1-microsoft-standard-WSL2 npm ERR! 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=/usr/src/node-red/node_modules/node-persistent-queue/node_modules/sqlite3/lib/binding/node-v93-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/usr/src/node-red/node_modules/node-persistent-queue/node_modules/sqlite3/lib/binding/node-v93-linux-x64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93" npm ERR! gyp ERR! cwd /usr/src/node-red/node_modules/node-persistent-queue/node_modules/sqlite3 npm ERR! gyp ERR! node -v v16.16.0 npm ERR! gyp ERR! node-gyp -v v9.0.0 npm ERR! gyp ERR! not ok npm ERR! node-pre-gyp ERR! build error npm ERR! 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=/usr/src/node-red/node_modules/node-persistent-queue/node_modules/sqlite3/lib/binding/node-v93-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/usr/src/node-red/node_modules/node-persistent-queue/node_modules/sqlite3/lib/binding/node-v93-linux-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1) npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/usr/src/node-red/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23) npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:527:28) npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1092:16) npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) npm ERR! node-pre-gyp ERR! System Linux 5.15.90.1-microsoft-standard-WSL2 npm ERR! node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/src/node-red/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" npm ERR! node-pre-gyp ERR! cwd /usr/src/node-red/node_modules/node-persistent-queue/node_modules/sqlite3 npm ERR! node-pre-gyp ERR! node -v v16.16.0 npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.10 npm ERR! node-pre-gyp ERR! not ok

I tried to update npm.

Node-RED imagem is the latest for docker.

Anyone has figured out how to solve this?

Thank you.

arabella3141 commented 1 year ago

@elyancorrea did u managed to install it in node-red for Docker? Or did you found an alternative for this node?

rzanetti-cpqd commented 1 year ago

I was facing the same issue trying to install on a docker image based on Ubuntu 20.04 LTS. Apparently it has to do with sqlite binaries not being available for that given OS. Changing the base image to nodered/node-red allowed installing this node on my side.

elyancorrea commented 1 year ago

I had to add this command on Dockerfile to install de nodes from package.json (node-red-contrib-msg-queue included):

RUN npm install --build-from-source --python=/usr/bin/python3 --unsafe-perm --no-update-notifier --no-fund --only=production

Apparently, add python path from container solve this.