Git Product home page Git Product logo

Comments (10)

Phil1pp avatar Phil1pp commented on August 27, 2024 3

I also had problems using this Node on the docker container "nodered/node-red:latest" which is based on alpine linux.
I managed to get it working by installing some additional packages from the command line:
apk add --no-cache build-base g++ cairo-dev jpeg-dev pango-dev giflib-dev
apk add --update --repository http://dl-3.alpinelinux.org/alpine/edge/testing libmount ttf-dejavu ttf-droid ttf-freefont ttf-liberation ttf-ubuntu-font-family fontconfig
npm install canvas

from node-red-contrib-face-recognition.

dborsnich avatar dborsnich commented on August 27, 2024

Hi, I have the same problem. I am running homeassistant ver 0.108.8 with docker. Node red addon 6.2.0

I tried with sudo and doesnยดt work

Regards

2020-04-22T19:12:36.665Z Install : node-red-contrib-face-recognition 1.3.3

2020-04-22T19:12:36.388Z npm install --no-audit --no-update-notifier --save --save-prefix="~" --production [email protected]
2020-04-22T19:12:48.191Z [out] 
2020-04-22T19:12:48.191Z [out] > [email protected] install /config/node-red/node_modules/canvas
2020-04-22T19:12:48.191Z [out] > node-pre-gyp install --fallback-to-build
2020-04-22T19:12:48.191Z [out] 
2020-04-22T19:12:48.459Z [err] node-pre-gyp
2020-04-22T19:12:48.459Z [err]  WARN 
2020-04-22T19:12:48.459Z [err] Using request for node-pre-gyp https download 
2020-04-22T19:12:49.676Z [err] node-pre-gyp
2020-04-22T19:12:49.677Z [err]  WARN Tried to download(404): https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v72-linux-musl-x64.tar.gz 
2020-04-22T19:12:49.677Z [err] node-pre-gyp WARN 
2020-04-22T19:12:49.677Z [err] Pre-built binaries not found for [email protected] and [email protected] (node-v72 ABI, musl) (falling back to source compile with node-gyp) 
2020-04-22T19:12:51.835Z [err] /bin/sh: pkg-config: not found
2020-04-22T19:12:51.836Z [err] gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
2020-04-22T19:12:51.844Z [err] gyp
2020-04-22T19:12:51.844Z [err]  
2020-04-22T19:12:51.844Z [err] ERR! configure error 
2020-04-22T19:12:51.845Z [err] gyp
2020-04-22T19:12:51.845Z [err]  ERR!
2020-04-22T19:12:51.845Z [err]  
2020-04-22T19:12:51.845Z [err] stack Error: `gyp` failed with exit code: 1
2020-04-22T19:12:51.845Z [err] gyp ERR!
2020-04-22T19:12:51.845Z [err]  stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
2020-04-22T19:12:51.845Z [err] gyp 
2020-04-22T19:12:51.845Z [err] ERR! 
2020-04-22T19:12:51.845Z [err] stack     at ChildProcess.emit (events.js:223:5)
2020-04-22T19:12:51.845Z [err] gyp
2020-04-22T19:12:51.845Z [err]  ERR! 
2020-04-22T19:12:51.845Z [err] stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
2020-04-22T19:12:51.845Z [err] gyp ERR! System Linux 4.15.0-96-generic
2020-04-22T19:12:51.845Z [err] gyp ERR!
2020-04-22T19:12:51.845Z [err]  command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/config/node-red/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/config/node-red/node_modules/canvas/build/Release" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
2020-04-22T19:12:51.845Z [err] gyp ERR! cwd /config/node-red/node_modules/canvas
2020-04-22T19:12:51.845Z [err] gyp 
2020-04-22T19:12:51.845Z [err] ERR! node -v v12.15.0
2020-04-22T19:12:51.845Z [err] gyp ERR! 
2020-04-22T19:12:51.845Z [err] node-gyp -v v5.0.5
2020-04-22T19:12:51.845Z [err] gyp
2020-04-22T19:12:51.845Z [err]  ERR! not ok 
2020-04-22T19:12:51.848Z [err] node-pre-gyp
2020-04-22T19:12:51.848Z [err]  ERR!
2020-04-22T19:12:51.848Z [err]  build error
2020-04-22T19:12:51.848Z [err]  
2020-04-22T19:12:51.849Z [err] node-pre-gyp
2020-04-22T19:12:51.849Z [err]  ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/config/node-red/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/config/node-red/node_modules/canvas/build/Release --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
2020-04-22T19:12:51.849Z [err] node-pre-gyp ERR! 
2020-04-22T19:12:51.849Z [err] stack     at ChildProcess.<anonymous> (/config/node-red/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
2020-04-22T19:12:51.849Z [err] node-pre-gyp 
2020-04-22T19:12:51.849Z [err] ERR! stack     at ChildProcess.emit (events.js:223:5)
2020-04-22T19:12:51.849Z [err] node-pre-gyp
2020-04-22T19:12:51.849Z [err]  ERR! stack
2020-04-22T19:12:51.849Z [err]      at maybeClose (internal/child_process.js:1021:16)
2020-04-22T19:12:51.849Z [err] node-pre-gyp 
2020-04-22T19:12:51.849Z [err] ERR! stack
2020-04-22T19:12:51.849Z [err]      at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
2020-04-22T19:12:51.849Z [err] node-pre-gyp
2020-04-22T19:12:51.849Z [err]  ERR! System Linux 4.15.0-96-generic
2020-04-22T19:12:51.849Z [err] node-pre-gyp
2020-04-22T19:12:51.849Z [err]  ERR! command "/usr/bin/node" "/config/node-red/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
2020-04-22T19:12:51.849Z [err] node-pre-gyp ERR!
2020-04-22T19:12:51.849Z [err]  cwd /config/node-red/node_modules/canvas
2020-04-22T19:12:51.849Z [err] node-pre-gyp ERR! node -v
2020-04-22T19:12:51.849Z [err]  v12.15.0
2020-04-22T19:12:51.849Z [err] node-pre-gyp ERR! 
2020-04-22T19:12:51.849Z [err] node-pre-gyp -v v0.11.0
2020-04-22T19:12:51.849Z [err] node-pre-gyp ERR! not ok 
2020-04-22T19:12:51.850Z [out] Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/config/node-red/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/config/node-red/node_modules/canvas/build/Release --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
2020-04-22T19:12:52.063Z [err] npm
2020-04-22T19:12:52.063Z [err]  ERR! code ELIFECYCLE
2020-04-22T19:12:52.063Z [err] npm 
2020-04-22T19:12:52.063Z [err] ERR! errno
2020-04-22T19:12:52.064Z [err]  1
2020-04-22T19:12:52.067Z [err] npm 
2020-04-22T19:12:52.067Z [err] ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
2020-04-22T19:12:52.067Z [err] npm ERR!
2020-04-22T19:12:52.067Z [err]  Exit status 1
2020-04-22T19:12:52.067Z [err] npm
2020-04-22T19:12:52.067Z [err]  ERR!
2020-04-22T19:12:52.067Z [err]  
2020-04-22T19:12:52.067Z [err] npm 
2020-04-22T19:12:52.067Z [err] ERR! Failed at the [email protected] install script.
2020-04-22T19:12:52.067Z [err] npm
2020-04-22T19:12:52.068Z [err]  ERR!
2020-04-22T19:12:52.068Z [err]  This is probably not a problem with npm. There is likely additional logging output above.
2020-04-22T19:12:52.175Z [err] 
2020-04-22T19:12:52.175Z [err] npm ERR! A complete log of this run can be found in:
2020-04-22T19:12:52.175Z [err] npm
2020-04-22T19:12:52.175Z [err]  ERR!
2020-04-22T19:12:52.176Z [err]      /root/.npm/_logs/2020-04-22T19_12_52_087Z-debug.log
2020-04-22T19:12:52.196Z rc=1

from node-red-contrib-face-recognition.

tomtom30 avatar tomtom30 commented on August 27, 2024

Recently I have update to node-red 1.0.4, and it was ok in 0.20 version for me

from node-red-contrib-face-recognition.

thebigpotatoe avatar thebigpotatoe commented on August 27, 2024

Failed at the [email protected] install script
node-pre-gyp: Permission denied

@tomtom30, seems like a canvas install issue, possibly due to either permissions or an unsupported architecture. By the looks of your other logs it seems as if you are running linux on a desktop?

Recently I have update to node-red 1.0.4, and it was ok in 0.20 version for me

Canvas does not rely on a version of node red. Did you also change your Node.js version as well? As the readme states, I only found one working combination of Node.js, tensroflow, and face-api.js that worked for me and a couple of others.

2020-04-22T19:12:49.677Z [err] Pre-built binaries not found for [email protected] and [email protected]

@dborsnich, again, incompatible versions of Node.js and canvas installed in your container.

from node-red-contrib-face-recognition.

tomtom30 avatar tomtom30 commented on August 27, 2024

Iam running docker in swarm mode with node-red in single container on linux server 18.04.
But it is docker environment at all.
When I said : "I have update" it is " I have update docker image 0.20 to 1.04".

bash-5.0# npm install node-red-contrib-face-recognition

> [email protected] install /usr/src/node-red/node_modules/canvas
> 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(404): https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v64-linux-musl-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI, musl) (falling back to source compile with node-gyp)
/bin/sh: pkg-config: not found
gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.15.0-55-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/src/node-red/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/usr/src/node-red/node_modules/canvas/build/Release" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64"
gyp ERR! cwd /usr/src/node-red/node_modules/canvas
gyp ERR! node -v v10.19.0
gyp ERR! node-gyp -v v5.0.5
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 configure --fallback-to-build --module=/usr/src/node-red/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/usr/src/node-red/node_modules/canvas/build/Release --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/src/node-red/node_modules/canvas/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:982:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Linux 4.15.0-55-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/src/node-red/node_modules/canvas/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/src/node-red/node_modules/canvas
node-pre-gyp ERR! node -v v10.19.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 configure --fallback-to-build --module=/usr/src/node-red/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/usr/src/node-red/node_modules/canvas/build/Release --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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/2020-04-22T23_46_01_356Z-debug.log

I have done a new try.
I get a 404 error, It try to get

canvas-v2.6.1-node-v64-linux-musl-x64.tar.gz

which does not exist
Can I choose an another version of canvas?

from node-red-contrib-face-recognition.

thebigpotatoe avatar thebigpotatoe commented on August 27, 2024

When I said : "I have update" it is " I have update docker image 0.20 to 1.04".

Forgive my ignorance, my docker knowledge is weak at best.

Can I choose an another version of canvas?

Not unless the binaries are built for you operating system. As you can see in the list of binaries from canvas prebuilt, canvas-v2.6.1-node-v64-linux-glibc-x64.tar.gz exists, but canvas-v2.6.1-node-v64-linux-musl-x64.tar.gz does not. So your version of linux is not supported by the library for a prebuilt download.

This doesn't mean however you cannot install canvas, you will just need to do it yourself. have a look at this thread over on the canvas page

from node-red-contrib-face-recognition.

dborsnich avatar dborsnich commented on August 27, 2024

I decide install node red directly to ubuntu server. There I have running docker and home assistant. I did a normal installation and works up to I decide to install tensor flow. It destroy the node red face rekonigtion and I will try to restart to last version. Tomorrow I'll update information. Thanks!

from node-red-contrib-face-recognition.

thebigpotatoe avatar thebigpotatoe commented on August 27, 2024

No worries, sounds promising.

I really do hate the incompatibility of packages for this lib, but since face-api.js relies on canvas to work we are stuck with it until an alternative is found.

Let us know how you go.

from node-red-contrib-face-recognition.

thebigpotatoe avatar thebigpotatoe commented on August 27, 2024

Thanks for the heads up. I just started using docker and linux this year for my own stuff and career, so I hope to eventually make this compatible with it out of the box. If you find any more commands that may help post them here.

Of course if you also have a docker file which is working for this also feel free to make a pull in the repo :)

from node-red-contrib-face-recognition.

andriusign avatar andriusign commented on August 27, 2024

Adding these two lines to .gitlab-ci.yml fixed the problem:
image

apk add --no-cache build-base g++ cairo-dev jpeg-dev pango-dev giflib-dev
apk add --update --repository http://dl-3.alpinelinux.org/alpine/edge/testing libmount ttf-dejavu ttf-droid ttf-freefont ttf-liberation ttf-ubuntu-font-family fontconfig

from node-red-contrib-face-recognition.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.