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

npm module sharp causes errors #101

Open
nzgrover opened this issue Jun 5, 2021 · 4 comments
Open

npm module sharp causes errors #101

nzgrover opened this issue Jun 5, 2021 · 4 comments

Comments

@nzgrover
Copy link

nzgrover commented Jun 5, 2021

Running 'npm install' in the ~/MagicMirror/modules/MMM-BackgroundSlideshow directory includes the following output:

> sharp@0.28.3 install /home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

sharp: Using cached /home/pi/.npm/_libvips/libvips-8.10.6-linux-armv6.tar.br
prebuild-install WARN install No prebuilt binaries found (target=3 runtime=napi arch=arm libc= platform=linux)
make: Entering directory '/home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_modules/sharp/build'
  CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
  AR(target) Release/obj.target/../node-addon-api/nothing.a
  COPY Release/nothing.a
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
  CXX(target) Release/obj.target/sharp/src/metadata.o
  CXX(target) Release/obj.target/sharp/src/stats.o
  CXX(target) Release/obj.target/sharp/src/operations.o
  CXX(target) Release/obj.target/sharp/src/pipeline.o
  CXX(target) Release/obj.target/sharp/src/utilities.o
  CXX(target) Release/obj.target/sharp/src/sharp.o
  SOLINK_MODULE(target) Release/obj.target/sharp.node
  COPY Release/sharp.node
make: Leaving directory '/home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_modules/sharp/build'
npm WARN mmm-backgroundslideshow@1.0.0 No repository field.

Starting MM gives a blank black screen with the following log output:

[05.06.2021 13:44.18.863] [LOG]   Starting MagicMirror: v2.15.0
[05.06.2021 13:44.18.868] [LOG]   Loading config ...
[05.06.2021 13:44.18.879] [LOG]   Loading module helpers ...
[05.06.2021 13:44.18.988] [ERROR] WARNING! Could not load config file. Starting with default configuration. Error found: Error: 'linux-armv6' binaries cannot be used on the 'linux-armv7' platform. Please remove the 'node_modules/sharp' directory and run 'npm install' on the 'linux-armv7' platform.
[05.06.2021 13:44.18.989] [LOG]   Loading module helpers ...
[05.06.2021 13:44.18.994] [ERROR] App threw an error during load
[05.06.2021 13:44.18.996] [ERROR] Error: 'linux-armv6' binaries cannot be used on the 'linux-armv7' platform. Please remove the 'node_modules/sharp' directory and run 'npm install' on the 'linux-armv7' platform.
    at Object.hasVendoredLibvips (/home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_modules/sharp/lib/libvips.js:82:13)
    at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_modules/sharp/lib/constructor.js:7:22)
    at Module._compile (internal/modules/cjs/loader.js:1152:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10)
    at Module.load (internal/modules/cjs/loader.js:992:32)
    at Module._load (internal/modules/cjs/loader.js:885:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12738)
    at Module.require (internal/modules/cjs/loader.js:1032:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_modules/sharp/lib/index.js:3:15)
[05.06.2021 13:44.18.997] [ERROR] Whoops! There was an uncaught exception...
[05.06.2021 13:44.19.002] [ERROR] Error: 'linux-armv6' binaries cannot be used on the 'linux-armv7' platform. Please remove the 'node_modules/sharp' directory and run 'npm install' on the 'linux-armv7' platform.
    at Object.hasVendoredLibvips (/home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_modules/sharp/lib/libvips.js:82:13)
    at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_modules/sharp/lib/constructor.js:7:22)
    at Module._compile (internal/modules/cjs/loader.js:1152:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10)
    at Module.load (internal/modules/cjs/loader.js:992:32)
    at Module._load (internal/modules/cjs/loader.js:885:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12738)
    at Module.require (internal/modules/cjs/loader.js:1032:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_modules/sharp/lib/index.js:3:15)
[05.06.2021 13:44.19.005] [ERROR] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
[05.06.2021 13:44.19.006] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
[05.06.2021 13:44.19.435] [LOG]   Launching application.

FYI

pi@raspberrypi:~/MagicMirror $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
@nzgrover
Copy link
Author

nzgrover commented Jun 5, 2021

I fixed this for my installation by executing the following commands:

pi@raspberrypi:~/MagicMirror/modules/MMM-BackgroundSlideshow $ npm uninstall sharp
npm WARN mmm-backgroundslideshow@1.0.0 No repository field.

removed 68 packages and audited 2 packages in 2.719s
found 0 vulnerabilities

pi@raspberrypi:~/MagicMirror/modules/MMM-BackgroundSlideshow $ npm install --arm-version 7 sharp

> sharp@0.28.3 install /home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.6/libvips-8.10.6-linux-armv7.tar.br
prebuild-install WARN install No prebuilt binaries found (target=3 runtime=napi arch=arm libc= platform=linux)
make: Entering directory '/home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_modules/sharp/build'
  CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
  AR(target) Release/obj.target/../node-addon-api/nothing.a
  COPY Release/nothing.a
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
  CXX(target) Release/obj.target/sharp/src/metadata.o
  CXX(target) Release/obj.target/sharp/src/stats.o
  CXX(target) Release/obj.target/sharp/src/operations.o
  CXX(target) Release/obj.target/sharp/src/pipeline.o
  CXX(target) Release/obj.target/sharp/src/utilities.o
  CXX(target) Release/obj.target/sharp/src/sharp.o
  SOLINK_MODULE(target) Release/obj.target/sharp.node
  COPY Release/sharp.node
make: Leaving directory '/home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_modules/sharp/build'
npm WARN mmm-backgroundslideshow@1.0.0 No repository field.

+ sharp@0.28.3
removed 1 package, updated 1 package and audited 70 packages in 78.51s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities

pi@raspberrypi:~/MagicMirror/modules/MMM-BackgroundSlideshow $ cd ..
pi@raspberrypi:~/MagicMirror/modules $ cd ..
pi@raspberrypi:~/MagicMirror $ npm start

@darickc
Copy link
Owner

darickc commented Jun 6, 2021

That's great.

@websterjazz
Copy link

@nzgrover
I ran npm uninstall sharp

And then npm install --arm-version 7 sharp

Here's what I got

> sharp@0.28.3 install /home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.6/libvips-8.10.6-linux-armvtrue.tar.br
sharp: Installation error: Prebuilt libvips 8.10.6 binaries are not yet available for linux-armvtrue
sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
npm WARN mmm-backgroundslideshow@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.28.3 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.28.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2021-06-10T18_59_26_177Z-debug.log


What do I do next?

@chimeranzl
Copy link

@nzgrover
I ran npm uninstall sharp

And then npm install --arm-version 7 sharp

Here's what I got

> sharp@0.28.3 install /home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.6/libvips-8.10.6-linux-armvtrue.tar.br
sharp: Installation error: Prebuilt libvips 8.10.6 binaries are not yet available for linux-armvtrue
sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
npm WARN mmm-backgroundslideshow@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.28.3 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.28.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2021-06-10T18_59_26_177Z-debug.log

What do I do next?

same issue here

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

No branches or pull requests

4 participants