Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when installing #16

Open
gijbelsy opened this issue Feb 18, 2022 · 12 comments · May be fixed by #18
Open

Error when installing #16

gijbelsy opened this issue Feb 18, 2022 · 12 comments · May be fixed by #18

Comments

@gijbelsy
Copy link

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
Copy link
Author

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

@labomat
Copy link

labomat commented Mar 19, 2022

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.

@anticommander
Copy link

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

@sdetweil
Copy link

see pr #18

@sdetweil sdetweil linked a pull request Oct 14, 2022 that will close this issue
@nfxhk
Copy link

nfxhk commented Jul 13, 2023

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

@sdetweil
Copy link

yes, use my fork which fixes install problem

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

use my url in the git clone

@nfxhk
Copy link

nfxhk commented Jul 13, 2023

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 $

@sdetweil
Copy link

you are using node 12, MagicMirror requires node 16.13

and NEVER use sudo on any module

try that again

@nfxhk
Copy link

nfxhk commented Jul 14, 2023 via email

@ktfcaptain
Copy link

yes, use my fork which fixes install problem

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

use my url in the git clone

This needs more attention!!

Thank you so much. Losing my mind over here lol

@sdetweil
Copy link

@ktfcaptain sorry, don't understand. did it work?

@ktfcaptain
Copy link

@ktfcaptain sorry, don't understand. did it work?

Yes, for that particular issue. Still trying to get other stuff to work, but I just go this to load so feeling somewhat accomplished...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants