project-chip / zap

ZAP stands for ZCL Advanced Platform. It is used to configure clusters, attributes and other entities for Matter and ZigbeePro applications.
Apache License 2.0
127 stars 81 forks source link

Installation failed due to missing system dependencies missing #143

Closed janusheide closed 3 years ago

janusheide commented 3 years ago

System: Debian 10 node v14.16.1 and v16.1.0 (installed via nvm)

On my machine installation failed due to missing dependencies of the canvas package, the log file did not contain anything useful.

I fixed that by installing the relevant system dependencies for canvas, see instructions here: https://www.npmjs.com/package/canvas


janus@janus-latitude:~/grundfos/zap$ npm install
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!

> zap@0.99.6 postinstall /home/janus/grundfos/zap
> electron-builder install-app-deps && husky install

  • electron-builder  version=22.10.5
  • loaded configuration  file=package.json ("build" field)
  • rebuilding native dependencies  dependencies=bufferutil@4.0.3, canvas@2.7.0, sqlite3@5.0.2, utf-8-validate@5.0.4 platform=linux arch=x64
  ⨯ cannot execute  cause=exit status 1
                    out=
    > bufferutil@4.0.3 install /home/janus/grundfos/zap/node_modules/bufferutil
    > node-gyp-build

    > canvas@2.7.0 install /home/janus/grundfos/zap/node_modules/canvas
    > node-pre-gyp install --fallback-to-build

    Failed to execute '/home/janus/.nvm/versions/node/v14.16.1/bin/node /home/janus/.nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/janus/grundfos/zap/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/janus/grundfos/zap/node_modules/canvas/build/Release --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=electron-v12.0' (1)

                    errorOut=node-pre-gyp WARN Using request for node-pre-gyp https download 
    node-pre-gyp WARN Tried to download(404): https://github.com/Automattic/node-canvas/releases/download/v2.7.0/canvas-v2.7.0-electron-v12.0-linux-glibc-x64.tar.gz 
    node-pre-gyp WARN Pre-built binaries not found for canvas@2.7.0 and electron@12.0.5 (electron-v12.0 ABI, glibc) (falling back to source compile with node-gyp) 
    Package pixman-1 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `pixman-1.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'pixman-1' found
    gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1 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 (/home/janus/.nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
    gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
    gyp ERR! System Linux 5.10.0-5-amd64
    gyp ERR! command "/home/janus/.nvm/versions/node/v14.16.1/bin/node" "/home/janus/.nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/janus/grundfos/zap/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/home/janus/grundfos/zap/node_modules/canvas/build/Release" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=electron-v12.0"
    gyp ERR! cwd /home/janus/grundfos/zap/node_modules/canvas
    gyp ERR! node -v v14.16.1
    gyp ERR! node-gyp -v v5.1.0
    gyp ERR! not ok 
    node-pre-gyp ERR! build error 
    node-pre-gyp ERR! stack Error: Failed to execute '/home/janus/.nvm/versions/node/v14.16.1/bin/node /home/janus/.nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/janus/grundfos/zap/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/janus/grundfos/zap/node_modules/canvas/build/Release --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=electron-v12.0' (1)
    node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/janus/grundfos/zap/node_modules/canvas/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
    node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
    node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1048:16)
    node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
    node-pre-gyp ERR! System Linux 5.10.0-5-amd64
    node-pre-gyp ERR! command "/home/janus/.nvm/versions/node/v14.16.1/bin/node" "/home/janus/grundfos/zap/node_modules/canvas/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
    node-pre-gyp ERR! cwd /home/janus/grundfos/zap/node_modules/canvas

```    node-pre-gyp ERR! node -v v14.16.1
    node-pre-gyp ERR! node-pre-gyp -v v0.15.0
    node-pre-gyp ERR! not ok 
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! canvas@2.7.0 install: `node-pre-gyp install --fallback-to-build`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the canvas@2.7.0 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!     /home/janus/.npm/_logs/2021-05-06T10_07_44_845Z-debug.log

                    command=/home/janus/.nvm/versions/node/v14.16.1/bin/node /home/janus/.nvm/versions/node/v14.16.1/lib/node_modules/npm/bin/npm-cli.js rebuild bufferutil@4.0.3 canvas@2.7.0 sqlite3@5.0.2 utf-8-validate@5.0.4
                    workingDir=
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! zap@0.99.6 postinstall: `electron-builder install-app-deps && husky install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the zap@0.99.6 postinstall 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!     /home/janus/.npm/_logs/2021-05-06T10_07_44_904Z-debug.log
janusheide commented 3 years ago

I also just tried to install zap on windows, where it failed because I dont have MSVS for compiling canvas :/

tecimovic commented 3 years ago

@janusheide : there is a document doc/faq.md in the repo, and it has a section "How to make this work on Windows?"

Did you try that and it still failed?

I will admit that we do not have a lot of Windows users. Entire development team is on Linux or Macs. But that should not be an excuse. We have to make this work on Windows as well.

janusheide commented 3 years ago

@tecimovic Personally I am running on Linux, but I am sitting in a department where Windows is the default, hence my attempt at Windows.

I did not read the specific guide for Windows, I just followed the readme :) Thanks for the pointer! It looks a bit manual, I know one of my collegues have it up and running via WSL(2) I dont know if that would be sufficient Windows support for you, but it might be easier than a "native" Windows install?

tecimovic commented 3 years ago

Yeah, Windows at this point is a problem. I am also 100% on Linux, and every other contributor to zap, from what I know, is also on Linux or Mac.

We are running an internal build at Silicon Labs on a Jenkins that makes Windows and Mac binary packages and out of each build. I have not yet figured out how to make that run on a public github CI, so github CI currently still just serves the Linux .deb and .rpm binaries.

So if you need a Windows binary I can definitely send it to you, but in the long run, obviously, we have to figure out how to make github itself build it and make it available.

If you figure anything out and make life for Windows users easier, PLEASE, do add any instructions to that faq MD right there! The core team which is developing this is sorely lacking any Windows users, so we'd be more than happy to get any kind of help in that area.