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

Cannot install Percollate dependencies #128

Closed
captainmalarky opened this issue Jul 7, 2021 · 5 comments
Closed

Cannot install Percollate dependencies #128

captainmalarky opened this issue Jul 7, 2021 · 5 comments

Comments

@captainmalarky
Copy link

I am attempting to install Percollate on a machine running Linux Mint Debian Edition 32bit. I have used NVM to install NPM 10.22.0, which has worked on other distros before. I believe that the issue may be due to this machine being 32bit? My virtual machines are 64bit.

I want to give this laptop to a friend who would find percollate useful.

Here is some of my terminal logging:
(name)@(name)-mint:~$ npm i -g percollate
/home/(name)/.nvm/versions/node/v10.22.0/bin/percollate -> /home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/percollate/cli.js
npm WARN [email protected] requires a peer of canvas@^2.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of chokidar@^3.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.

[email protected] install /home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/canvas
node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v64-linux-glibc-ia32.tar.gz
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v64-linux-glibc-ia32.tar.gz
Package pixman-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing pixman-1.pc' to the PKG_CONFIG_PATH environment variable No package 'pixman-1' found gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gypfailed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16) gyp ERR! stack at ChildProcess.emit (events.js:198:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) gyp ERR! System Linux 4.19.0-17-686 gyp ERR! command "/home/(name)/.nvm/versions/node/v10.22.0/bin/node" "/home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/canvas/build/Release" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64" gyp ERR! cwd /home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/canvas gyp ERR! node -v v10.22.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/home/(name)/.nvm/versions/node/v10.22.0/bin/node /home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/canvas/build/Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1) node-pre-gyp ERR! stack at ChildProcess.cmd.on (/home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/canvas/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:198:13) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:982:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) node-pre-gyp ERR! System Linux 4.19.0-17-686 node-pre-gyp ERR! command "/home/(name)/.nvm/versions/node/v10.22.0/bin/node" "/home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/canvas/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/canvas node-pre-gyp ERR! node -v v10.22.0 node-pre-gyp ERR! node-pre-gyp -v v1.0.5 node-pre-gyp ERR! not ok Failed to execute '/home/(name)/.nvm/versions/node/v10.22.0/bin/node /home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/canvas/build/Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] install:node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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/(name)/.npm/_logs/2021-07-07T13_47_19_661Z-debug.log
(name)@(name)-mint:~$ node -v
v10.22.0

Attempting to create a PDF results in the following:
(name)@(name)-mint:~$ percollate pdf https://www.dailymaverick.co.za/article/2021-07-06-new-evidence-confirms-allegations-of-murder-and-torture-by-eswatini-military-and-police/
Fetching: https://www.dailymaverick.co.za/article/2021-07-06-new-evidence-confirms-allegations-of-murder-and-torture-by-eswatini-military-and-police/
Enhancing web page: https://www.dailymaverick.co.za/article/2021-07-06-new-evidence-confirms-allegations-of-murder-and-torture-by-eswatini-military-and-police/
(node:9062) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
/home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/percollate/node_modules/puppeteer/.local-chromium/linux-818858/chrome-linux/chrome: 1: /home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/percollate/node_modules/puppeteer/.local-chromium/linux-818858/chrome-linux/chrome: Syntax error: "(" unexpected

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

at onClose (/home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/percollate/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:20)
at Interface.helper_js_1.helper.addEventListener (/home/(name)/.nvm/versions/node/v10.22.0/lib/node_modules/percollate/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:183:68)
at Interface.emit (events.js:203:15)
at Interface.close (readline.js:397:8)
at Socket.onend (readline.js:173:10)
at Socket.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)

(node:9062) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:9062) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I would appreciate your suggestions in regards to correctly installing the required dependencies?

Also, will the Snap be ready soon? Or perhaps an apt package? This is hell.

@danburzo
Copy link
Owner

danburzo commented Jul 7, 2021

Hi @captainmalarky, from the log I see a couple of things:

  • npm install -g percollate produces some (false) requirements — jsdom should work well without canvas, so there's no need to npm install -g canvas (which seems to fail).
  • the actual problem seems to be that Puppeteeer can't launch the Chromium browser. Have you had a chance to take a look at this section from the Puppeteer troubleshooting page? It lists dependencies on various distributions.

I'm not sure of the status of @mcphail's percollate Snap (#103), I don't have the knowledge necessary to contribute there...

@mcphail
Copy link

mcphail commented Jul 7, 2021

The snap package is usable, as it stands, but would need some upstream changes in snapd to be truly useful. I've watched some important members of the snapd team move to new jobs and I don't think it is likely these changes will come soon, if ever. For the time being I've had to park development of the snap, I'm afraid.

@captainmalarky
Copy link
Author

captainmalarky commented Jul 7, 2021 via email

@danburzo
Copy link
Owner

danburzo commented Oct 8, 2021

@captainmalarky would you be able to test again using latest percollate (2.0.0)? I've upgraded dependencies, including Puppeteer, to their latest versions, and I hope some portability improvements are included. (Please note Node 12+ is required)

@danburzo
Copy link
Owner

danburzo commented May 1, 2022

I'm going to close this issue, please let me know if this continues to be a problem.

@danburzo danburzo closed this as completed May 1, 2022
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

3 participants