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

Can’t Install sharp on Raspberry Pi, using EOL Node.js #3815

Closed
Luke6285 opened this issue Oct 3, 2023 · 3 comments
Closed

Can’t Install sharp on Raspberry Pi, using EOL Node.js #3815

Luke6285 opened this issue Oct 3, 2023 · 3 comments

Comments

@Luke6285
Copy link

Luke6285 commented Oct 3, 2023

Tried several things suggested in the documentation and stackoverflow with various flags and deleting things but have had no luck so far...

Operating System: Raspbian GNU/Linux 10 (buster)
Kernel: Linux 5.4.51+
Architecture: arm

npm install --verbose sharp

npm info it worked if it ends with ok
npm verb cli [ '/usr/local/bin/node',
npm verb cli '/usr/local/bin/npm',
npm verb cli 'install',
npm verb cli '--verbose',
npm verb cli 'sharp' ]
npm info using npm@5.6.0
npm info using node@v9.7.1
npm verb config Skipping project config: /home/pi/.npmrc. (matches userconfig)
npm verb npm-session 621cf2e50df766e0
npm http fetch GET 200 https://registry.npmjs.org/sharp 356ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/color 141ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/color-convert 92ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/color-name 1178ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/fsevents 393ms (from cache)
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm verb correctMkdir /home/pi/.npm/_locks correctMkdir not in flight; initializing
npm verb lock using /home/pi/.npm/_locks/staging-8a58fe8d264b10c5.lock for /home/pi/node_modules/.staging
npm info lifecycle color-name@1.1.4preinstall: color-name@1.1.4
npm info lifecycle color-convert@2.0.1
preinstall: color-convert@2.0.1
npm info lifecycle color@4.2.3preinstall: color@4.2.3
npm info lifecycle sharp@0.32.6
preinstall: sharp@0.32.6
npm info linkStuff color-name@1.1.4
npm verb linkBins color-name@1.1.4
npm verb linkMans color-name@1.1.4
npm info linkStuff color-convert@2.0.1
npm verb linkBins color-convert@2.0.1
npm verb linkMans color-convert@2.0.1
npm info linkStuff color@4.2.3
npm verb linkBins color@4.2.3
npm verb linkMans color@4.2.3
npm info linkStuff sharp@0.32.6
npm verb linkBins sharp@0.32.6
npm verb linkMans sharp@0.32.6
npm info lifecycle color-name@1.1.4install: color-name@1.1.4
npm info lifecycle color-convert@2.0.1
install: color-convert@2.0.1
npm info lifecycle color@4.2.3install: color@4.2.3
npm info lifecycle sharp@0.32.6
install: sharp@0.32.6

sharp@0.32.6 install /home/pi/node_modules/sharp
(node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

/home/pi/node_modules/tar-fs/node_modules/tar-stream/constants.js:12
} catch {
^

SyntaxError: Unexpected token {
at new Script (vm.js:51:7)
at createScript (vm.js:136:10)
at Object.runInThisContext (vm.js:197:10)
at Module._compile (module.js:626:28)
at Object.Module._extensions..js (module.js:673:10)
at Module.load (module.js:575:32)
at tryModuleLoad (module.js:515:12)
at Function.Module._load (module.js:507:3)
at Module.require (module.js:606:17)
at require (internal/module.js:11:18)
npm verb lifecycle sharp@0.32.6install: unsafe-perm in lifecycle true
npm verb lifecycle sharp@0.32.6
install: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/pi/node_modules/sharp/node_modules/.bin:/home/pi/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
npm verb lifecycle sharp@0.32.6install: CWD: /home/pi/node_modules/sharp
npm info lifecycle sharp@0.32.6
install: Failed to exec install script
npm verb unlock done using /home/pi/.npm/_locks/staging-8a58fe8d264b10c5.lock for /home/pi/node_modules/.staging
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: linux
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: arm
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm verb enoent This is related to npm not being able to find a file.
npm verb enoent
npm WARN ws@8.14.2 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws@8.14.2 requires a peer of utf-8-validate@>=5.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

npm verb stack Error: sharp@0.32.6 install: (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm verb stack Exit status 1
npm verb stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
npm verb stack at EventEmitter.emit (events.js:127:13)
npm verb stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
npm verb stack at ChildProcess.emit (events.js:127:13)
npm verb stack at maybeClose (internal/child_process.js:936:16)
npm verb stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
npm verb pkgid sharp@0.32.6
npm verb cwd /home/pi
npm verb Linux 5.4.51+
npm verb argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--verbose" "sharp"
npm verb node v9.7.1
npm verb npm v5.6.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.32.6 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.32.6 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 1, true ]

@lovell
Copy link
Owner

lovell commented Oct 3, 2023

npm info using node@v9.7.1

https://sharp.pixelplumbing.com/install#prerequisites

Prerequisites
Node.js >= 14.15.0

@lovell lovell changed the title Can’t Install sharp on Raspberry Pi Can’t Install sharp on Raspberry Pi, using EOL Node.js Oct 3, 2023
@Luke6285
Copy link
Author

Luke6285 commented Oct 3, 2023

Thank you! Sorry I totally missed that. Since I was unable to install a sufficient official version on my Raspberry Pi Zero, I got it working with an unofficial build (v14.17.0). I needed to manually upgrade node-gyp independently of npm though after getting an error during the sharp installation but it worked out!

@lovell
Copy link
Owner

lovell commented Oct 3, 2023

Glad you got it working. You may be interested in #3750 as it will provide prebuilt sharp binaries for ARMv6.

@lovell lovell closed this as completed Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants