MMM-Buttons icon indicating copy to clipboard operation
MMM-Buttons copied to clipboard

Error when installing

Open gijbelsy opened this issue 3 years ago • 12 comments

I'm receiving the following error when trying to install MMM-Buttons:

pi@MagicMirror:~/MagicMirror/modules/MMM-Buttons $ npm install

> [email protected] postinstall
> node_modules/.bin/electron-rebuild -e node_modules/electron

⠋ Searching dependency tree
An unhandled error occurred inside electron-rebuild
Could not detect abi for version 17.0.1 and runtime electron.  Updating "node-abi" might help solve this issue if it is a new release of electron

Error: Could not detect abi for version 17.0.1 and runtime electron.  Updating "node-abi" might help solve this issue if it is a new release of electron
    at Object.getAbi (/home/pi/MagicMirror/modules/MMM-Buttons/node_modules/node-abi/index.js:36:9)
    at new Rebuilder (/home/pi/MagicMirror/modules/MMM-Buttons/node_modules/electron-rebuild/lib/src/rebuild.js:126:48)
    at rebuildWithOptions (/home/pi/MagicMirror/modules/MMM-Buttons/node_modules/electron-rebuild/lib/src/rebuild.js:404:23)
    at Object.doRebuild [as rebuild] (/home/pi/MagicMirror/modules/MMM-Buttons/node_modules/electron-rebuild/lib/src/rebuild.js:427:16)
    at /home/pi/MagicMirror/modules/MMM-Buttons/node_modules/electron-rebuild/lib/src/cli.js:124:33
    at Generator.next (<anonymous>)
    at fulfilled (/home/pi/MagicMirror/modules/MMM-Buttons/node_modules/electron-rebuild/lib/src/cli.js:6:58)
npm ERR! code 255
npm ERR! path /home/pi/MagicMirror/modules/MMM-Buttons
npm ERR! command failed
npm ERR! command sh -c node_modules/.bin/electron-rebuild -e node_modules/electron

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2022-02-18T11_12_17_532Z-debug-0.log

It seems that the sh -c node_modules/.bin/electron-rebuild -e node_modules/electron command causes problems. Any solution to this?

gijbelsy avatar Feb 18 '22 11:02 gijbelsy

It seems that there are breaking changes in node-js v17. Downgrading to v14 resolved the issue. But still, this needs to be adressed.

gijbelsy avatar Feb 18 '22 16:02 gijbelsy

I have the same problem after upgrading to MM 2.18.0 Maybe it is the same problem as described here: https://forum.magicmirror.builders/topic/16074/electron-rebuild-and-magicmirror-v2-18-and-more I tried the steps but it didn't work.

labomat avatar Mar 19 '22 10:03 labomat

Follow the instructions in the readme to clone the repository. Then edit package.json and under devDependencies replace

"electron-rebuild": "^1.2.1"

with

"magicmirror-rebuild": "^1.0.0"

and under scripts replace

"postinstall": "node_modules/.bin/electron-rebuild -e ../../node_modules/electron"

with

"postinstall": "node_modules/.bin/MagicMirror-rebuild -e ../../node_modules/electron"

Save your changes to package.json and run npm install

anticommander avatar Sep 26 '22 12:09 anticommander

see pr #18

sdetweil avatar Oct 14 '22 22:10 sdetweil

I still can't install even after making those changes. Any ideas?

npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '[email protected]', npm WARN EBADENGINE required: { node: '^14.17.0 || ^16.13.0 || >=18.0.0' }, npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '[email protected]', npm WARN EBADENGINE required: { node: '^14.17.0 || ^16.13.0 || >=18.0.0' }, npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '[email protected]', npm WARN EBADENGINE required: { node: '^14.17.0 || ^16.13.0 || >=18.0.0' }, npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '[email protected]', npm WARN EBADENGINE required: { node: '^14.17.0 || ^16.13.0 || >=18.0.0' }, npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '@npmcli/[email protected]', npm WARN EBADENGINE required: { node: '^14.17.0 || ^16.13.0 || >=18.0.0' }, npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '[email protected]', npm WARN EBADENGINE required: { node: '^14.17.0 || ^16.13.0 || >=18.0.0' }, npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '[email protected]', npm WARN EBADENGINE required: { node: '>=16 || 14 >=14.17' }, npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '[email protected]', npm WARN EBADENGINE required: { node: '^14.17.0 || ^16.13.0 || >=18.0.0' }, npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '[email protected]', npm WARN EBADENGINE required: { node: '^14.17.0 || ^16.13.0 || >=18.0.0' }, npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '[email protected]', npm WARN EBADENGINE required: { node: '>=14' }, npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '[email protected]', npm WARN EBADENGINE required: { node: '>=14' }, npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '[email protected]', npm WARN EBADENGINE required: { node: '>=16 || 14 >=14.17' }, npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '[email protected]', npm WARN EBADENGINE required: { node: '>=16 || 14 >=14.17' }, npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '[email protected]', npm WARN EBADENGINE required: { node: '>=14' }, npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '[email protected]', npm WARN EBADENGINE required: { node: '14 || >=16.14' }, npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '[email protected]', npm WARN EBADENGINE required: { node: '>=16 || 14 >=14.17' }, npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' } npm WARN EBADENGINE }

[email protected] postinstall node_modules/.bin/MagicMirror-rebuild -e ../../node_modules/electron

⠏ MagicMirror Building module: epoll, Completed: 0gyp info find Python using Python version 3.10.12 found at "/usr/bin/python3"

An unhandled error occurred inside electron-rebuild Unexpected token '.'

/home/nfogarty/MagicMirror/modules/MMM-Buttons/node_modules/ssri/lib/index.js:16 const getOptString = options => options?.length ? ?${options.join('?')} : '' ^

SyntaxError: Unexpected token '.' at wrapSafe (internal/modules/cjs/loader.js:915:16) at Module._compile (internal/modules/cjs/loader.js:963:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (/home/nfogarty/MagicMirror/modules/MMM-Buttons/node_modules/make-fetch-happen/lib/cache/policy.js:3:14) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) npm ERR! code 255 npm ERR! path /home/nfogarty/MagicMirror/modules/MMM-Buttons npm ERR! command failed npm ERR! command sh -c node_modules/.bin/MagicMirror-rebuild -e ../../node_modules/electron

npm ERR! A complete log of this run can be found in: npm ERR! /home/nfogarty/.npm/_logs/2023-07-13T13_26_49_955Z-debug.log

nfxhk avatar Jul 13 '23 13:07 nfxhk

yes, use my fork which fixes install problem

https://github.com/sdetweil/MMM-Buttons

use my url in the git clone

sdetweil avatar Jul 13 '23 15:07 sdetweil

Thanks so much for replying, I did try your fork and I get a different error. Any ideas?

nfogarty@homepi:~/MagicMirror/modules $ sudo git clone https://github.com/sdetweil/MMM-Buttons Cloning into 'MMM-Buttons'... remote: Enumerating objects: 56, done. remote: Counting objects: 100% (4/4), done. remote: Compressing objects: 100% (4/4), done. remote: Total 56 (delta 0), reused 2 (delta 0), pack-reused 52 Receiving objects: 100% (56/56), 11.86 KiB | 176.00 KiB/s, done. Resolving deltas: 100% (25/25), done. nfogarty@homepi:~/MagicMirror/modules $ cd MMM-Buttons/ nfogarty@homepi:~/MagicMirror/modules/MMM-Buttons $ ls CHANGELOG.md node_helper.js postinstall MMM-Buttons.js package.json README.md nfogarty@homepi:~/MagicMirror/modules/MMM-Buttons $ sudo npm install npm ERR! code 1 npm ERR! path /home/nfogarty/MagicMirror/modules/MMM-Buttons/node_modules/epoll npm ERR! command failed npm ERR! command sh -c node-gyp rebuild npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using [email protected] npm ERR! gyp info using [email protected] | linux | arm64 npm ERR! gyp info find Python using Python version 3.10.12 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/share/nodejs/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/nfogarty/MagicMirror/modules/MMM-Buttons/node_modules/epoll/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/usr/share/nodejs/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/usr/include/nodejs/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=/usr/include/nodejs', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/share/nodejs/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/usr/include/nodejs/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/nfogarty/MagicMirror/modules/MMM-Buttons/node_modules/epoll', 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! Traceback (most recent call last): npm ERR! File "/usr/share/nodejs/node-gyp/gyp/gyp_main.py", line 33, in npm ERR! sys.exit(load_entry_point('gyp==0.1', 'console_scripts', 'gyp')()) npm ERR! File "/usr/share/nodejs/node-gyp/gyp/gyp_main.py", line 22, in importlib_load_entry_point npm ERR! for entry_point in distribution(dist_name).entry_points npm ERR! File "/usr/local/lib/python3.10/importlib/metadata/init.py", line 969, in distribution npm ERR! return Distribution.from_name(distribution_name) npm ERR! File "/usr/local/lib/python3.10/importlib/metadata/init.py", line 548, in from_name npm ERR! raise PackageNotFoundError(name) npm ERR! importlib.metadata.PackageNotFoundError: No package metadata was found for 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 (/usr/share/nodejs/node-gyp/lib/configure.js:355:16) npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:314:20) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12) npm ERR! gyp ERR! System Linux 6.1.21-v8+ npm ERR! gyp ERR! command "/usr/bin/node" "/usr/share/nodejs/node-gyp/bin/node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd /home/nfogarty/MagicMirror/modules/MMM-Buttons/node_modules/epoll npm ERR! gyp ERR! node -v v12.22.12 npm ERR! gyp ERR! node-gyp -v v7.1.2 npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2023-07-13T23_28_26_717Z-debug.log nfogarty@homepi:~/MagicMirror/modules/MMM-Buttons $

nfxhk avatar Jul 13 '23 23:07 nfxhk

you are using node 12, MagicMirror requires node 16.13

and NEVER use sudo on any module

try that again

sdetweil avatar Jul 14 '23 00:07 sdetweil

You’re right! Thank you so much it worked!

On 14 Jul 2023, at 9:23 am, sam detweiler @.***> wrote:

you are using node 12, MagicMirror requires node 16.13

and NEVER use sudo on any module

try that again

— Reply to this email directly, view it on GitHub https://github.com/Jopyth/MMM-Buttons/issues/16#issuecomment-1635084465, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABI7VIV3CKVLGS5ASARIWDDXQCGPRANCNFSM5OXSWVKQ. You are receiving this because you commented.

nfxhk avatar Jul 14 '23 11:07 nfxhk