본문 바로가기
Smart Home/MATTER

run_zaptool.sh 실행 오류 => 해결

by 감자최고 2022. 12. 6.

언제부터인가 run_zaptool.sh 가 실행되지 않는다..

뭐가 에러인지도 알 수 없다...

 

npm ERR! code 1
npm ERR! path /home/gamja/connectedhomeip/third_party/zap/repo/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute '/home/gamja/connectedhomeip/.environment/cipd/packages/pigweed/bin/node /home/gamja/connectedhomeip/.environment/cipd/packages/pigweed/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/gamja/connectedhomeip/third_party/zap/repo/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/gamja/connectedhomeip/third_party/zap/repo/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (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.9
npm ERR! node-pre-gyp info using node@18.4.0 | linux | x64
npm ERR! node-pre-gyp info check checked for "/home/gamja/connectedhomeip/third_party/zap/repo/node_modules/canvas/build/Release/canvas.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.9.1/canvas-v2.9.1-node-v108-linux-glibc-x64.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.9.1/canvas-v2.9.1-node-v108-linux-glibc-x64.tar.gz 
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for canvas@2.9.1 and node@18.4.0 (node-v108 ABI, glibc) (falling back to source compile with node-gyp) 
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.9.1/canvas-v2.9.1-node-v108-linux-glibc-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@18.4.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@18.4.0 | linux | x64
npm ERR! gyp info find Python using Python version 3.8.10 found at "/home/gamja/connectedhomeip/.environment/pigweed-venv/bin/python3"
npm ERR! gyp info spawn /home/gamja/connectedhomeip/.environment/pigweed-venv/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/gamja/connectedhomeip/.environment/cipd/packages/pigweed/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   '/home/gamja/connectedhomeip/third_party/zap/repo/node_modules/canvas/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/gamja/connectedhomeip/.environment/cipd/packages/pigweed/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/gamja/.cache/node-gyp/18.4.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=/home/gamja/.cache/node-gyp/18.4.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/gamja/connectedhomeip/.environment/cipd/packages/pigweed/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/gamja/.cache/node-gyp/18.4.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/gamja/connectedhomeip/third_party/zap/repo/node_modules/canvas',
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! Package pangocairo was not found in the pkg-config search path.
npm ERR! Perhaps you should add the directory containing `pangocairo.pc'
npm ERR! to the PKG_CONFIG_PATH environment variable
npm ERR! No package 'pangocairo' found
npm ERR! gyp: Call to 'pkg-config pangocairo --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/home/gamja/connectedhomeip/.environment/cipd/packages/pigweed/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:261:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:537:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 5.15.0-52-generic
npm ERR! gyp ERR! command "/home/gamja/connectedhomeip/.environment/cipd/packages/pigweed/bin/node" "/home/gamja/connectedhomeip/.environment/cipd/packages/pigweed/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/gamja/connectedhomeip/third_party/zap/repo/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/home/gamja/connectedhomeip/third_party/zap/repo/node_modules/canvas/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108"
npm ERR! gyp ERR! cwd /home/gamja/connectedhomeip/third_party/zap/repo/node_modules/canvas
npm ERR! gyp ERR! node -v v18.4.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 '/home/gamja/connectedhomeip/.environment/cipd/packages/pigweed/bin/node /home/gamja/connectedhomeip/.environment/cipd/packages/pigweed/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/gamja/connectedhomeip/third_party/zap/repo/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/gamja/connectedhomeip/third_party/zap/repo/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/gamja/connectedhomeip/third_party/zap/repo/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:537:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Linux 5.15.0-52-generic
npm ERR! node-pre-gyp ERR! command "/home/gamja/connectedhomeip/.environment/cipd/packages/pigweed/bin/node" "/home/gamja/connectedhomeip/third_party/zap/repo/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /home/gamja/connectedhomeip/third_party/zap/repo/node_modules/canvas
npm ERR! node-pre-gyp ERR! node -v v18.4.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.9
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/gamja/.npm/_logs/2022-12-06T13_40_34_513Z-debug-0.log

==================================================================================

2023.02.20 

https://stackoverflow.com/questions/64562563/how-can-i-ovecome-this-error-in-npm-install

sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
npm install canvas

이렇게 하고 나니 에러 양상이 바뀜.

 App · Compiling SPA...
⇝   Error: error:0308010C:digital envelope routines::unsupported
  
  - hash:67 new Hash
    node:internal/crypto/hash:67:19
  
  - node:crypto:133 Object.createHash
    node:crypto:133:10
  
  - createHash.js:135 module.exports

============================================================================================

https://onlydev.tistory.com/114

nodejs 버전을 바꿔보라는데..

pigweed 설정 파일을 아래 처럼 변경하고,

third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/cipd_setup/pigweed.json 에 

    {
      "path": "infra/3pp/tools/nodejs/${platform}",
      "platforms": [
        "linux-amd64",
        "linux-arm64",
        "mac-amd64",
        "mac-arm64",
        "windows-amd64"
      ],
      "tags": [
        "version:2@16.13.0"
      ]
    },

바꾸고 나니.. 드디어 떴음 ㅜ.ㅜ

댓글