Closed wolfgangmauer closed 10 months ago
Hey Wolfgang!
Is that problem still present?
If so, please make sure you use a recent node version (>= 18) and the newest code.
Yes :-( -> Pi 32-bit Lite OS
pi@raspberry:~/vantelligence_connector $ node ./ node:internal/errors:496 ErrorCaptureStackTrace(err); ^
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'chalk' imported from /home/pi/vantelligence_connector/app.js
at new NodeError (node:internal/errors:405:5)
at packageResolve (node:internal/modules/esm/resolve:782:9)
at moduleResolve (node:internal/modules/esm/resolve:831:20)
at defaultResolve (node:internal/modules/esm/resolve:1036:11)
at DefaultModuleLoader.resolve (node:internal/modules/esm/loader:251:12)
at DefaultModuleLoader.getModuleJob (node:internal/modules/esm/loader:140:32)
at ModuleWrap.
Node.js v20.5.1
pi@raspberry:~/vantelligence_connector $ npm install chalk
npm ERR! code 1
npm ERR! path /home/pi/vantelligence_connector/node_modules/rpio
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! make: Entering directory '/home/pi/vantelligence_connector/node_modules/rpio/build'
npm ERR! CXX(target) Release/obj.target/rpio/src/rpio.o
npm ERR! make: Leaving directory '/home/pi/vantelligence_connector/node_modules/rpio/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.4.0
npm ERR! gyp info using node@20.5.1 | linux | arm
npm ERR! gyp info find Python using Python version 3.9.2 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/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/pi/vantelligence_connector/node_modules/rpio/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/pi/.cache/node-gyp/20.5.1/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/pi/.cache/node-gyp/20.5.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/home/pi/.cache/node-gyp/20.5.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/pi/vantelligence_connector/node_modules/rpio',
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 spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../../nan/nan.h:178,
npm ERR! from ../src/rpio.cc:17:
npm ERR! ../../nan/nan_callbacks.h:55:23: error: ‘AccessorSignature’ is not a member of ‘v8’
npm ERR! 55 | typedef v8::Local~~~~
npm ERR! ../../nan/nan_callbacks.h:55:40: error: template argument 1 is invalid
npm ERR! 55 | typedef v8::Local~~~~~~~
npm ERR! In file included from ../src/rpio.cc:17:
npm ERR! ../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local~~
npm ERR! /home/pi/.cache/node-gyp/20.5.1/include/node/v8-template.h:814:22: note: no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
npm ERR! 814 | SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
npm ERR! | ~~~^~~~~~~~~~~~
npm ERR! /home/pi/.cache/node-gyp/20.5.1/include/node/v8-template.h:816:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local~~
npm ERR! /home/pi/.cache/node-gyp/20.5.1/include/node/v8-template.h:821:22: note: no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
npm ERR! 821 | SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
npm ERR! | ~~~^~~~~~~~~~~~
npm ERR! In file included from ../../nan/nan.h:58,
npm ERR! from ../src/rpio.cc:17:
npm ERR! ../src/rpio.cc: At global scope:
npm ERR! /home/pi/.cache/node-gyp/20.5.1/include/node/node.h:1166:7: warning: cast between incompatible function types from ‘void (~~~~~~~~
npm ERR! /home/pi/.cache/node-gyp/20.5.1/include/node/node.h:1200:3: note: in expansion of macro ‘NODE_MODULE_X’
npm ERR! 1200 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
npm ERR! | ^~~~~
npm ERR! ../src/rpio.cc:600:1: note: in expansion of macro ‘NODE_MODULE’
npm ERR! 600 | NODE_MODULE(rpio, setup)
npm ERR! | ^~~
npm ERR! make: *** [rpio.target.mk:116: Release/obj.target/rpio/src/rpio.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: make
failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:514:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Linux 6.1.21-v8+
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/pi/vantelligence_connector/node_modules/rpio
npm ERR! gyp ERR! node -v v20.5.1
npm ERR! gyp ERR! node-gyp -v v9.4.0
npm ERR! gyp ERR! not ok
Hey Wolfgang! Wenn du dir einen neuen Stand ziehts (git pull), mach danach am besten immer ein "npm install" hinterher. Denn es kommen immer wieder mal neue Pakete/Abhängigkeiten hinzu, ohne die das Ganze möglicherweise nicht läuft.
Mach ich genau so, mit 64Bit und 32Bit(RPi OS Lite) ausprobiert, ohne Erfolg....
Es scheint wohl bei dem OS-Lite was zu fehlen, mit der "Full" geht der "npm install" ABER ich habe wohl noch Probleme mit den Abhängigkeiten...
pi@raspberrypi:~/vantelligence_connector $ node ./app.js ✨ Device class found: ADS1115.js node:internal/modules/cjs/loader:1319 return process.dlopen(module, path.toNamespacedPath(filename)); ^
Error: libnode.so.72: cannot open shared object file: No such file or directory
at Module._extensions..node (node:internal/modules/cjs/loader:1319:18)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at require (node:internal/modules/helpers:130:18)
at bindings (/home/pi/vantelligence_connector/node_modules/bindings/bindings.js:112:48)
at Object.
Node.js v20.5.1 pi@raspberrypi:~/vantelligence_connector $
Kannst du folgendes versuchen?
Welche Distri hast du denn installiert?
Das Pi OS 64-Bit Full
Bekomme wieder den Übersetzungsfehler mit der "Full" :-(
Es liegt offensichtlich an der Node-Version. Mit
sudo su curl` -fsSL https://deb.nodesource.com/setup_lts.x | bash - && apt-get install -y nodejs exit
funktioniert alles ;-)
Ich mache noch ein Installationsscript und nehme das da mit rein.
file:///home/wolfgang/vantelligence_connector/device/BME280.js:47 if (values?.temperature_C) { ^
SyntaxError: Unexpected token '.' at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18) at async link (internal/modules/esm/module_job.js:42:21)
I don't know js at all, but with C# it's a check for "null". If I remove the question mark, everything works.... Do I have too old programs?
raspberry pi 4: npm -> 7.5.2 raspberry pi 4: nodejs -> v12.22.12