Solved Error when starting Gateway
-
“Error when loading: node-pty. Try to solve it with ‘npm run rebuild’ in Gateway directory”
However, an error occurs when reinstalling:
“Error: ‘make’ failed with exit code: 2”
“Error: node-gyp failed to rebuild…”
Please tell me how you can solve this problem. Thank you! -
Hi,
For better helping, can have have more informations ?
- What’s pi version ?
- What’s OS ?
- What’s OS version ?
- What’s OS architecture ? (arm or arm64 for example)
- What’s node version ?
- What’s npm version (optional) ?
Thanks
-
Pi version: 3b+
OS: Raspbian GNU/Linux 11
OS architecture: armhf
node version: 16.15.1
npm version: 8.11.0 -
thx, can i have all logs of MagicMirror rebuild step ?
-
@bugsounet of course, if you can tell me where to find it
-
Right, Can I have the result of this command in a terminal?
cd ~/MagicMirror/modules/Gateway/ && npm run postinstall
thanks
-
Gateway@2.1.4 postinstall
installer/postinstall.sh⠴ MagicMirror Building module: node-pty, Completed: 0gyp info find Python using Python version 3.9.2 found at “/usr/bin/python3”
⠧ MagicMirror Building module: node-pty, Completed: 0gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args ‘/home/user/MagicMirror/modules/Gateway/node_modules/node-gyp/gyp/gyp_main.py’,
gyp info spawn args ‘binding.gyp’,
gyp info spawn args ‘-f’,
gyp info spawn args ‘make’,
gyp info spawn args ‘-I’,
gyp info spawn args ‘/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/build/config.gypi’,
gyp info spawn args ‘-I’,
gyp info spawn args ‘/home/user/MagicMirror/modules/Gateway/node_modules/node-gyp/addon.gypi’,
gyp info spawn args ‘-I’,
gyp info spawn args ‘/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/common.gypi’,
gyp info spawn args ‘-Dlibrary=shared_library’,
gyp info spawn args ‘-Dvisibility=default’,
gyp info spawn args ‘-Dnode_root_dir=/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0’,
gyp info spawn args ‘-Dnode_gyp_dir=/home/user/MagicMirror/modules/Gateway/node_modules/node-gyp’,
gyp info spawn args ‘-Dnode_lib_file=/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/<(target_arch)/node.lib’,
gyp info spawn args ‘-Dmodule_root_dir=/home/user/MagicMirror/modules/Gateway/node_modules/node-pty’,
gyp info spawn args ‘-Dnode_engine=v8’,
gyp info spawn args ‘–depth=.’,
gyp info spawn args ‘–no-parallel’,
gyp info spawn args ‘–generator-output’,
gyp info spawn args ‘build’,
gyp info spawn args ‘-Goutput_dir=.’
gyp info spawn args ]
⠹ MagicMirror Building module: node-pty, Completed: 0gyp info spawn make
gyp info spawn args [ ‘BUILDTYPE=Release’, ‘-C’, ‘build’ ]
⠸ MagicMirror Building module: node-pty, Completed: 0make: вход в каталог «/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/build»
CXX(target) Release/obj.target/pty/src/unix/pty.o
⠴ MagicMirror Building module: node-pty, Completed: 0In file included from /home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/v8-local-handle.h:12,
from /home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/v8-array-buffer.h:12,
from /home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/v8.h:25,
from /home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/node.h:63,
from …/…/nan/nan.h:60,
from …/src/unix/pty.cc:20:
/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/v8-internal.h:113:27: error: static assertion failed: Pointer compression can be enabled only for 64-bit architectures
113 | kApiSystemPointerSize == kApiInt64Size,
| ~~~~~~~~~^
/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/v8-internal.h:471:68: warning: left shift count >= width of type [-Wshift-count-overflow]
471 | static constexpr size_t kPtrComprCageReservationSize = size_t{1} << 32;
| ~~~~~~^/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/v8-internal.h:471:68: error: right operand of shift expression ‘(1 << 32)’ is greater than or equal to the precision 32 of the left operand [-fpermissive]
/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/v8-internal.h:472:66: warning: left shift count >= width of type [-Wshift-count-overflow]
472 | static constexpr size_t kPtrComprCageBaseAlignment = size_t{1} << 32;
|~~~~~~~~~~~~~~~~~~^
/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/v8-internal.h:472:66: error: right operand of shift expression ‘(1 << 32)’ is greater than or equal to the precision 32 of the left operand [-fpermissive]
/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/v8-internal.h:509:48: warning: conversion from ‘long long unsigned int’ to ‘size_t’ {aka ‘unsigned int’} changes value from ‘1099511627776’ to ‘0’ [-Woverflow]
509 | constexpr size_t kVirtualMemoryCageSize = 1ULL << kVirtualMemoryCageSizeLog2;
| ~^
/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/v8-internal.h:528:60: warning: conversion from ‘long long unsigned int’ to ‘size_t’ {aka ‘unsigned int’} changes value from ‘34359738368’ to ‘0’ [-Woverflow]
528 | constexpr size_t kVirtualMemoryCageGuardRegionSize = 32ULL * GB;
| ^
/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/v8-internal.h:531:45: error: non-constant condition for static assertion
530 | static_assert((kVirtualMemoryCageGuardRegionSize %
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
531 | kVirtualMemoryCageAlignment) == 0,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/v8-internal.h:542:56: warning: conversion from ‘long long unsigned int’ to ‘size_t’ {aka ‘unsigned int’} changes value from ‘34359738368’ to ‘0’ [-Woverflow]
542 | constexpr size_t kVirtualMemoryCageMinimumSize = 32ULL * GB;
| ^
/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/v8-internal.h:557:66: warning: conversion from ‘long long unsigned int’ to ‘size_t’ {aka ‘unsigned int’} changes value from ‘8589934592’ to ‘0’ [-Woverflow]
557 | constexpr size_t kFakeVirtualMemoryCageMinReservationSize = 8ULL * GB;
| ^
/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/v8-internal.h:559:45: error: non-constant condition for static assertion
559 | static_assert(kVirtualMemoryCageMinimumSize >
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
560 | Internals::kPtrComprCageReservationSize,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/v8-internal.h:563:56: error: non-constant condition for static assertion
563 | static_assert(kFakeVirtualMemoryCageMinReservationSize >
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
564 | Internals::kPtrComprCageReservationSize,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
⠧ MagicMirror Building module: node-pty, Completed: 0In file included from /home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/v8.h:53,
from /home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/node.h:63,
from …/…/nan/nan.h:60,
from …/src/unix/pty.cc:20:
/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/v8-script.h:232:79: warning: ‘using ResolveCallback = class v8::MaybeLocalv8::Module (*)(class v8::Localv8::Context, class v8::Localv8::String, class v8::Localv8::Module)’ is deprecated: Use ResolveModuleCallback [-Wdeprecated-declarations]
232 | ResolveCallback callback);
| ^/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/v8-script.h:214:9: note: declared here
214 | using ResolveCallback V8_DEPRECATED(“Use ResolveModuleCallback”) =
| ^~~~~~~~~~~~~~~
⠼ MagicMirror Building module: node-pty, Completed: 0…/src/unix/pty.cc: In function ‘void pty_after_waitpid(uv_async_t*)’:
…/src/unix/pty.cc:512:43: warning: ‘void* memset(void*, int, size_t)’ writing to an object of type ‘class Nan::Persistentv8::Function’ with no trivial copy-assignment [-Wclass-memaccess]
512 | memset(&baton->cb, -1, sizeof(baton->cb));
| ^
In file included from …/…/nan/nan.h:409,
from …/src/unix/pty.cc:20:
…/…/nan/nan_persistent_12_inl.h:12:40: note: ‘class Nan::Persistentv8::Function’ declared here
12 | template<typename T, typename M> class Persistent :
| ^~~~~~~~~~
In file included from …/…/nan/nan.h:60,
from …/src/unix/pty.cc:20:
…/src/unix/pty.cc: At global scope:
/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/node.h:832:7: warning: cast between incompatible function types from ‘void ()(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void ()(v8::Localv8::Object)’} to ‘node::addon_register_func’ {aka ‘void ()(v8::Localv8::Object, v8::Localv8::Value, void)’} [-Wcast-function-type]
832 | (node::addon_register_func) (regfunc),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/17.2.0/include/node/node.h:866:3: note: in expansion of macro ‘NODE_MODULE_X’
866 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
| ^~~~~~~~~~~~~
…/src/unix/pty.cc:734:1: note: in expansion of macro ‘NODE_MODULE’
734 | NODE_MODULE(pty, init)
| ^~~~~~~~~~~
⠹ MagicMirror Building module: node-pty, Completed: 0make: *** [pty.target.mk:121: Release/obj.target/pty/src/unix/pty.o] Ошибка 1
make: выход из каталога «/home/user/MagicMirror/modules/Gateway/node_modules/node-pty/build»
MagicMirror Rebuild Failed
An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild ‘/home/user/MagicMirror/modules/Gateway/node_modules/node-pty’.
Error:make
failed with exit code: 2Error: node-gyp failed to rebuild ‘/home/user/MagicMirror/modules/Gateway/node_modules/node-pty’.
Error:make
failed with exit code: 2at ModuleRebuilder.rebuildNodeGypModule (/home/user/MagicMirror/modules/Gateway/node_modules/magicmirror-rebuild/build/module-rebuilder.js:193:19) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Rebuilder.rebuildModuleAt (/home/user/MagicMirror/modules/Gateway/node_modules/magicmirror-rebuild/build/rebuild.js:180:9) at async Rebuilder.rebuild (/home/user/MagicMirror/modules/Gateway/node_modules/magicmirror-rebuild/build/rebuild.js:143:17) at async /home/user/MagicMirror/modules/Gateway/node_modules/magicmirror-rebuild/build/cli.js:141:9
Support is now moved in a dedicated Server: https://forum.bugsounet.fr
@bugsounetGateway is now installed !
-
I suspect that you use an x64 version of Raspbian
can you confirm with this this command in terminal:
uname -m
response must be :
armv7l
-
This post is deleted! -
@bugsounet Yes, armv7l was displayed
-
I tried to reinstall the system and the magic mirror modules themselves. When installing EXT modules, this error still appears(
-
Hi, no problem with this image
From raspberrypi.com officiel page(OS 32bits with desktop)
-
I’m facing the same issue even after reinstalling everything using 2022-04-04-raspios-bullseye-armhf-full.img.xz: my setup: Pi 4, armv7l, Raspbian GNU/Linux 11, npm v6.14.17, node v14.19.3, installing MagicMirror according to official website, and bugsounet: MMM-GA, Gateway, EXT-Detector, I’m getting the error: “Error when loading: node-pty. Try to solve it with ‘npm run rebuild’ in Gateway directory”. I have also installed OpenCV before, could that be a reason for this error?
-
If I send you a link (Raspberry Pi OS with desktop), it’s not for download another (Raspberry Pi OS with desktop and recommended software)
this image not another
-
@bugsounet thanks, sorry but I didn’t installed the “another” with recommended softwares, it was actually the 2022-04-04-raspios-bullseye-armhf.img.xz as recommended.
-
well, I reinstalled the system again using this img, but the problem remained as it was
-
humm… ok, really sincerly, i don’t know.
Maybe like you saysI have also installed OpenCV before
So, do you try this :
- install OS
- install git and install curl (
sudo apt-get install git curl
) - install nodejs from source:
curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
sudo apt-get install -y nodejs
- (yes i know … it’s v16)
- git Clone MagicMirror
- install MagicMirror
- git clone GW
- install GW
I have tested it, last week, Fresh install on RPI 3b+ with no problem, That why I don’t understand
I can’t do again a fresh install on my prod rpi. Why ? I have a very very long uptime (~130 Days) and i don’t want to break it , I make a challenge -
@bugsounet Thanks a lot for your response. I agree with you. If you installed it from a fresh install and it worked, so, in my case, it should be something related to OpenCV installation. I’ll reinstall everything again, following the sequence you seggested, and then I’ll let you know if it works.
-
Or another way … it’s
gcc v11
sucks- try to install
gcc v10
and make it by default
sudo apt-get install gcc-10 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10 sudo update-alternatives --config gcc
–> choose gcc v10 by default
- Go to GW directory and rebuild it (reinstall)
cd ~/MagicMirror/modules/Gateway npm run rebuild
- try to install
-
Hi again,
I have started over from a fresh install using this image, followed by the installation of:- MagicMirror
- MMM-GoogleAssistant
- EXT-Detector
- Gateway
in this sequence… At this time I haven’t installed anything else besides this things. However, the problem remains, so there is nothing to do with OpenCV. I’m getting the same log posted by @Sun4eek on Jun 24, 2.15 PM, where the following error pops up.
Error: node-gyp failed to rebuild ‘/home/user/MagicMirror/modules/Gateway/node_modules/node-pty’. Error: make failed with exit code: 2
The same problem happens when installing EXT-Detector. I have also tried rebuid Gateway using
gcc 10
as suggested, but it doesn’t work as well.