Solved [ERROR] [GATEWAY] [LIB] node-pty Loading error!
-
Hey everyone,
I am struggeling a bit to get this wonderful Module working again after the latest MM Update.
I get the following error (using npm start dev):
[ERROR] [GATEWAY] [LIB] node-pty Loading error! Error: The module ‘/home/pi/MagicMirror/modules/Gateway/node_modules/node-pty/build/Release/pty.node’I already tried solving it using ‘npm run rebuild’ in the Gateway directory and even reinstalled Gateway all together, but I get the same error regardless.
Does someone experience the same or have an idea on how to fix this?
Any help is much appreciated!
Thanks
-
Hi,
can you try this in
Gateway
Foldernpm run reset && npm run clean && npm install
tell me if any error on MagicMirror rebuild step and past if needed
-
Hi,
I just did that, but terminal does not show any obvious errors. Do you wanna see the whole output? It’s quite big.
Searching for “node-pty” in the output, the only thing I find is this:
make: Entering directory ‘/home/pi/MagicMirror/modules/Gateway/node_modules/node-pty/build’
CXX(target) Release/obj.target/pty/src/unix/pty.o
SOLINK_MODULE(target) Release/obj.target/pty.node
COPY Release/pty.node
make: Leaving directory ‘/home/pi/MagicMirror/modules/Gateway/node_modules/node-pty/build’Is there anything else I could try?
Thanks!
-
It says
MagicMirror Rebuild failed
or not? -
Not it does not fail, it just says “Done” at the end.
Done Support is now moved in a dedicated Server: https://forum.bugsounet.fr @bugsounet Gateway is now installed ! added 553 packages, and audited 554 packages in 12m 73 packages are looking for funding run `npm fund` for details 10 moderate severity vulnerabilities To address issues that do not require attention, run: npm audit fix To address all issues possible (including breaking changes), run: npm audit fix --force Some issues need review, and may require choosing a different dependency. Run `npm audit` for details.
-
OK, what’s node version used?
-
v18.16.0
-
If it’s says “Done”, It means that there is no problem
where do you install Gateway ? -
I have installed it in the modules directory. It used to work for many many months. Just after the last MagicMirror update it stopped working with the error mentioned above.
-
can you enable debug mode in GW and past again the error
[ERROR] [GATEWAY] [LIB] node-pty Loading error! Error: ...
I will have more details -
Sure thing, no problem
[09.07.2023 11:42.22.978] [LOG] [GATEWAY] Gateway Version: 3.4.0 rev: 230708 [09.07.2023 11:42.23.196] [LOG] [GA] [CONFIG_MERGE] Read config.js and check ConfigDeepMerge... [09.07.2023 11:42.23.202] [LOG] [GA] [CONFIG_MERGE] Perfect ConfigDeepMerge activated! [09.07.2023 11:42.23.204] [LOG] [GA] [SECURE] Check digital footprint... [09.07.2023 11:42.23.251] [LOG] [GA] [DATA] Platform: 'raspberry-pi'; attempting to use 'arecord' to access microphone ... [09.07.2023 11:42.23.256] [LOG] [GA] [DATA] Google Assistant is initialized. [09.07.2023 11:42.23.595] [INFO] Checking git for module: MMM-Cursor [09.07.2023 11:42.23.686] [LOG] [GA] [SECURE] Happy use ! [09.07.2023 11:42.24.088] [LOG] [GATEWAY] [LIB] Loaded: ../components/GWTools.js -> this.lib.GWTools [09.07.2023 11:42.24.092] [LOG] [GATEWAY] [LIB] Loaded: ../components/SHTools.js -> this.lib.SHTools [09.07.2023 11:42.24.099] [LOG] [GATEWAY] [LIB] Loaded: ../components/GatewayMiddleware.js -> this.lib.Gateway [09.07.2023 11:42.24.105] [LOG] [GATEWAY] [LIB] Loaded: ../components/hyperwatch.js -> this.lib.hyperwatch [09.07.2023 11:42.24.110] [LOG] [GATEWAY] [LIB] Loaded: ../components/SmartHomeMiddleware.js -> this.lib.SmartHome [09.07.2023 11:42.24.114] [LOG] [GATEWAY] [LIB] Loaded: ../components/actionsOnGoogle.js -> this.lib.ActionsOnGoogle [09.07.2023 11:42.24.119] [LOG] [GATEWAY] [LIB] Loaded: ../components/DeviceManagement.js -> this.lib.Device [09.07.2023 11:42.24.122] [LOG] [GATEWAY] [LIB] Loaded: ../components/SHCallbacks.js -> this.lib.callback [09.07.2023 11:42.24.126] [LOG] [GATEWAY] [LIB] Loaded: ../components/homegraph.js -> this.lib.homegraph [09.07.2023 11:42.24.129] [LOG] [GATEWAY] [LIB] Loaded: ../components/systemInformation.js -> this.lib.SystemInformation [09.07.2023 11:42.24.132] [LOG] [GATEWAY] [LIB] Loaded: ../components/speedtest.js -> this.lib.speedtest [09.07.2023 11:42.24.138] [LOG] [GATEWAY] [LIB] Loaded: ../components/speedtest-net.js -> this.lib.speedtest-net [09.07.2023 11:42.24.232] [ERROR] innerError Error: Cannot find module '../build/Debug/pty.node' Require stack: - /home/pi/MagicMirror/modules/Gateway/node_modules/node-pty/lib/unixTerminal.js - /home/pi/MagicMirror/modules/Gateway/node_modules/node-pty/lib/index.js - /home/pi/MagicMirror/modules/Gateway/components/loadLibraries.js - /home/pi/MagicMirror/modules/Gateway/components/parseData.js - /home/pi/MagicMirror/modules/Gateway/node_helper.js - /home/pi/MagicMirror/js/app.js - /home/pi/MagicMirror/js/electron.js - /home/pi/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js - at Module._resolveFilename (node:internal/modules/cjs/loader:1082:15) at n._resolveFilename (node:electron/js2c/browser_init:2:117457) at Module._resolveFilename (/home/pi/MagicMirror/node_modules/module-alias/index.js:49:29) at Module._load (node:internal/modules/cjs/loader:927:27) at f._load (node:electron/js2c/asar_bundle:2:13330) at Module.require (node:internal/modules/cjs/loader:1148:19) at require (node:internal/modules/cjs/helpers:110:18) at Object.<anonymous> (/home/pi/MagicMirror/modules/Gateway/node_modules/node-pty/lib/unixTerminal.js:34:15) at Module._compile (node:internal/modules/cjs/loader:1269:14) at Module._extensions..js (node:internal/modules/cjs/loader:1324:10) at Module.load (node:internal/modules/cjs/loader:1124:32) at Module._load (node:internal/modules/cjs/loader:965:12) at f._load (node:electron/js2c/asar_bundle:2:13330) at Module.require (node:internal/modules/cjs/loader:1148:19) at require (node:internal/modules/cjs/helpers:110:18) at Object.<anonymous> (/home/pi/MagicMirror/modules/Gateway/node_modules/node-pty/lib/index.js:14:20) { code: 'MODULE_NOT_FOUND', requireStack: [ '/home/pi/MagicMirror/modules/Gateway/node_modules/node-pty/lib/unixTerminal.js', '/home/pi/MagicMirror/modules/Gateway/node_modules/node-pty/lib/index.js', '/home/pi/MagicMirror/modules/Gateway/components/loadLibraries.js', '/home/pi/MagicMirror/modules/Gateway/components/parseData.js', '/home/pi/MagicMirror/modules/Gateway/node_helper.js', '/home/pi/MagicMirror/js/app.js', '/home/pi/MagicMirror/js/electron.js', '/home/pi/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js', undefined ] } [09.07.2023 11:42.24.235] [ERROR] [GATEWAY] [LIB] node-pty Loading error! Error: The module '/home/pi/MagicMirror/modules/Gateway/node_modules/node-pty/build/Release/pty.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 110. This version of Node.js requires NODE_MODULE_VERSION 116. Please try re-compiling or re-installing the module (for instance, using `npm rebuild` or `npm install`). at process.func [as dlopen] (node:electron/js2c/asar_bundle:2:1822) at Module._extensions..node (node:internal/modules/cjs/loader:1354:18) at Object.func [as .node] (node:electron/js2c/asar_bundle:2:1822) at Module.load (node:internal/modules/cjs/loader:1124:32) at Module._load (node:internal/modules/cjs/loader:965:12) at f._load (node:electron/js2c/asar_bundle:2:13330) at Module.require (node:internal/modules/cjs/loader:1148:19) at require (node:internal/modules/cjs/helpers:110:18) at Object.<anonymous> (/home/pi/MagicMirror/modules/Gateway/node_modules/node-pty/lib/unixTerminal.js:29:11) at Module._compile (node:internal/modules/cjs/loader:1269:14) at Module._extensions..js (node:internal/modules/cjs/loader:1324:10) at Module.load (node:internal/modules/cjs/loader:1124:32) at Module._load (node:internal/modules/cjs/loader:965:12) at f._load (node:electron/js2c/asar_bundle:2:13330) at Module.require (node:internal/modules/cjs/loader:1148:19) at require (node:internal/modules/cjs/helpers:110:18) { code: 'ERR_DLOPEN_FAILED' } [09.07.2023 11:42.24.240] [LOG] [GATEWAY] [LIB] Loaded: express -> this.lib.express [09.07.2023 11:42.24.241] [LOG] [GATEWAY] [LIB] Loaded: http -> this.lib.http [09.07.2023 11:42.24.537] [LOG] [GATEWAY] [LIB] Loaded: semver -> this.lib.semver [09.07.2023 11:42.24.541] [LOG] [GATEWAY] [LIB] Loaded: body-parser -> this.lib.bodyParser [09.07.2023 11:42.24.684] [LOG] [GATEWAY] [LIB] Loaded: express-session -> this.lib.session [09.07.2023 11:42.24.785] [LOG] [GATEWAY] [LIB] Loaded: passport -> this.lib.passport [09.07.2023 11:42.24.805] [LOG] [GATEWAY] [LIB] Loaded: passport-local -> this.lib.LocalStrategy [09.07.2023 11:42.25.382] [LOG] [GATEWAY] [LIB] Loaded: socket.io -> this.lib.Socket [09.07.2023 11:42.25.384] [LOG] [GATEWAY] [LIB] Loaded: cors -> this.lib.cors [09.07.2023 11:42.25.386] [LOG] [GATEWAY] [LIB] Loaded: path -> this.lib.path [09.07.2023 11:42.25.387] [LOG] [GATEWAY] [LIB] Loaded: child_process -> this.lib.childProcess [09.07.2023 11:42.25.558] [LOG] [GATEWAY] [LIB] Loaded: node-fetch -> this.lib.fetch [09.07.2023 11:42.25.560] [LOG] [GATEWAY] [LIB] Loaded: fs -> this.lib.fs [09.07.2023 11:42.25.582] [LOG] [GATEWAY] [LIB] Loaded: util -> this.lib.util [09.07.2023 11:42.25.776] [LOG] [GATEWAY] [LIB] Loaded: systeminformation -> this.lib.si [09.07.2023 11:42.26.728] [LOG] [GATEWAY] [LIB] Loaded: pm2 -> this.lib.pm2 [09.07.2023 11:42.26.729] [LOG] [GATEWAY] [LIB] Loaded: readline -> this.lib.readline [09.07.2023 11:42.26.730] [LOG] [GATEWAY] [LIB] Loaded: stream -> this.lib.Stream [09.07.2023 11:42.32.934] [LOG] [GATEWAY] [LIB] Loaded: actions-on-google -> this.lib.actions [09.07.2023 11:42.32.937] [LOG] [GATEWAY] [LIB] Loaded: googleapis -> this.lib.googleapis [09.07.2023 11:42.32.938] [LOG] [GATEWAY] [LIB] Loaded: google-auth-library -> this.lib.GoogleAuthLibrary [09.07.2023 11:42.33.028] [LOG] [GATEWAY] [LIB] Loaded: lodash -> this.lib._ [09.07.2023 11:42.33.034] [LOG] [GATEWAY] [LIB] Loaded: moment -> this.lib.moment [09.07.2023 11:42.33.076] [LOG] [GATEWAY] [LIB] Loaded: mkdirp -> this.lib.mkdirp [09.07.2023 11:42.33.077] [LOG] [GATEWAY] [LIB] Loaded: https -> this.lib.https [09.07.2023 11:42.33.504] [LOG] [GATEWAY] [LIB] Loaded: decompress -> this.lib.decompress [09.07.2023 11:42.33.505] [LOG] [GATEWAY] [LIB] Loaded: decompress-tar -> this.lib.decompressTar [09.07.2023 11:42.33.506] [LOG] [GATEWAY] [LIB] Loaded: decompress-tarbz2 -> this.lib.decompressTarbz2 [09.07.2023 11:42.33.507] [LOG] [GATEWAY] [LIB] Loaded: decompress-targz -> this.lib.decompressTargz [09.07.2023 11:42.33.508] [LOG] [GATEWAY] [LIB] Loaded: decompress-unzip -> this.lib.decompressUnzip [09.07.2023 11:42.33.729] [LOG] [GATEWAY] [LIB] Loaded: @felipecrs/decompress-tarxz -> this.lib.decompressTarXz [09.07.2023 11:42.33.734] [LOG] [GATEWAY] [LIB] Loaded: tree-kill -> this.lib.kill [09.07.2023 11:42.33.742] [LOG] [GATEWAY] [LIB] Loaded: sha256-file -> this.lib.sha256_file [09.07.2023 11:42.33.747] [LOG] [GATEWAY] Detected: MMM-GoogleAssistant [09.07.2023 11:42.33.775] [ERROR] [GATEWAY] Warning: 1 needed library not loaded ! [09.07.2023 11:42.33.778] [ERROR] [GATEWAY] Try to solve it with `npm run rebuild` in Gateway directory
-
it says:
Error: The module '/home/pi/MagicMirror/modules/Gateway/node_modules/node-pty/build/Release/pty.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 110. This version of Node.js requires NODE_MODULE_VERSION 116.
humm, … what’s the electron vesion used ?
can you try this:
cd ~/Magicmirror cat package-lock.json |grep "electron" |grep "resolved" |grep -v "@electron" |grep -v "chromium"
can you past the result of this command?
-
Sure, that’s what it says:
"resolved": "https://registry.npmjs.org/electron/-/electron-25.2.0.tgz", "resolved": "https://registry.npmjs.org/electron/-/electron-25.2.0.tgz",
-
npm ERR! code 1
npm ERR! path /home/semy821/MagicMirror/modules/Gateway/node_modules/node-pty
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! make: Entering directory ‘/home/semy821/MagicMirror/modules/Gateway/node_modules/node-pty/build’
npm ERR! CXX(target) Release/obj.target/pty/src/unix/pty.o
npm ERR! make: Leaving directory ‘/home/semy821/MagicMirror/modules/Gateway/node_modules/node-pty/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@18.17.0 | linux | x64
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 ‘/home/semy821/MagicMirror/modules/Gateway/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/semy821/MagicMirror/modules/Gateway/node_modules/node-pty/build/config.gypi’,
npm ERR! gyp info spawn args ‘-I’,
npm ERR! gyp info spawn args ‘/home/semy821/MagicMirror/modules/Gateway/node_modules/node-gyp/addon.gypi’,
npm ERR! gyp info spawn args ‘-I’,
npm ERR! gyp info spawn args ‘/home/semy821/.cache/node-gyp/18.17.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/semy821/.cache/node-gyp/18.17.0’,
npm ERR! gyp info spawn args ‘-Dnode_gyp_dir=/home/semy821/MagicMirror/modules/Gateway/node_modules/node-gyp’,
npm ERR! gyp info spawn args ‘-Dnode_lib_file=/home/semy821/.cache/node-gyp/18.17.0/<(target_arch)/node.lib’,
npm ERR! gyp info spawn args ‘-Dmodule_root_dir=/home/semy821/MagicMirror/modules/Gateway/node_modules/node-pty’,
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 /usr/include/errno.h:25,
npm ERR! from /home/semy821/.cache/node-gyp/18.17.0/include/node/uv/errno.h:25,
npm ERR! from /home/semy821/.cache/node-gyp/18.17.0/include/node/uv.h:54,
npm ERR! from …/…/nan/nan.h:59,
npm ERR! from …/src/unix/pty.cc:20:
npm ERR! /usr/include/features.h:461:12: fatal error: sys/cdefs.h: No such file or directory
npm ERR! 461 | # include <sys/cdefs.h>
npm ERR! | ^~~~~~~~~~~~~
npm ERR! compilation terminated.
npm ERR! make: *** [pty.target.mk:115: Release/obj.target/pty/src/unix/pty.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 (/home/semy821/MagicMirror/modules/Gateway/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:291:12)
npm ERR! gyp ERR! System Linux 5.10.0-15-amd64
npm ERR! gyp ERR! command “/usr/local/bin/node” “/home/semy821/MagicMirror/modules/Gateway/node_modules/.bin/node-gyp” “rebuild”
npm ERR! gyp ERR! cwd /home/semy821/MagicMirror/modules/Gateway/node_modules/node-pty
npm ERR! gyp ERR! node -v v18.17.0
npm ERR! gyp ERR! node-gyp -v v9.4.0
npm ERR! gyp ERR! not oknpm ERR! A complete log of this run can be found in: /home/semy821/.npm/_logs/2023-08-07T18_13_00_404Z-debug-0.log
-
Hi I am new to this coding stuff.
I have some errors that includes node-pty -
Pre-require will not help you?
I see:
npm ERR! gyp ERR! System Linux 5.10.0-15-amd64
npm ERR! gyp info using node@18.17.0 | linux | x64
npm ERR! /usr/include/features.h:461:12: fatal error: sys/cdefs.h: No such file or directory
I don’t think it’s a pi
Best way is:
- Read wiki
- Open your own issue
- Don’t search to do a common issue (90% of case… It’s not the same
- Read log of error
What’s coding do you do?
-
bugsounet