tiktok-scraper icon indicating copy to clipboard operation
tiktok-scraper copied to clipboard

Unable to install on Ubuntu Mate 20.04

Open github-userx opened this issue 1 year ago • 13 comments

Describe the bug Unable to install on Ubuntu mate 20.04.

If fields below will be empty then issue will be Ignored and Closed

To Reproduce Steps to reproduce the behavior:

  • Ubuntu Mate 20.04
  • NodeJs Version: v10.19.0
mate@mate:~$ sudo npm i -g tiktok-scraper
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: request-promise has been deprecated because it extends the now deprecated request pa
ckage, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circum
stances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
/usr/local/bin/tiktok-scraper -> /usr/local/lib/node_modules/tiktok-scraper/bin/cli.js

[email protected] install /usr/local/lib/node_modules/tiktok-scraper/node_modules/canvas
node-pre-gyp install --fallback-to-build --update-binary

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 ENOENT: no such file or directory, mkdir
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/tiktok-scraper/node_modules/canvas/build'
gyp ERR! System Linux 5.4.0-125-generic
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "configure" "--fallback-to-build" "--update-binary" "--module=/usr/local/l
ib/node_modules/tiktok-scraper/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/usr/local/
lib/node_modules/tiktok-scraper/node_modules/canvas/build/Release" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_vers
ion=0" "--node_napi_label=node-v64"
gyp ERR! cwd /usr/local/lib/node_modules/tiktok-scraper/node_modules/canvas
gyp ERR! node -v v10.19.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/bin/node-gyp configure --fallback-to-build --update-binary
--module=/usr/local/lib/node_modules/tiktok-scraper/node_modules/canvas/build/Release/canvas.node --module_name=canvas --modul
e_path=/usr/local/lib/node_modules/tiktok-scraper/node_modules/canvas/build/Release --napi_version=5 --node_abi_napi=napi --nap
i_build_version=0 --node_napi_label=node-v64' (1)
node-pre-gyp ERR! stack at ChildProcess.cmd.on (/usr/local/lib/node_modules/tiktok-scraper/node_modules/@mapbox/node-pre-gy
p/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 5.4.0-125-generic
node-pre-gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/tiktok-scraper/node_modules/.bin/node-pre-gyp" "install"
"--fallback-to-build" "--update-binary"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/tiktok-scraper/node_modules/canvas
node-pre-gyp ERR! node -v v10.19.0
node-pre-gyp ERR! node-pre-gyp -v v1.0.10
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/bin/node-gyp configure --fallback-to-build --update-binary --module=/usr/local/lib/node_m
odules/tiktok-scraper/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/usr/local/lib/node_modu
les/tiktok-scraper/node_modules/canvas/build/Release --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_l
abel=node-v64' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build --update-binary
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! /root/.npm/_logs/2022-09-17T18_06_10_086Z-debug.log
mate@mate-optiplex:~$

github-userx avatar Sep 17 '22 18:09 github-userx

Same problem here on MacOS, any solution ?

palmthree-studio avatar Sep 18 '22 13:09 palmthree-studio

Have seen this issue before. Had to upgrade to node 12.x for it to work.

mandys avatar Sep 18 '22 15:09 mandys

Have seen this issue before. Had to upgrade to node 12.x for it to work.

I've node 16+, and the problem remains ...

palmthree-studio avatar Sep 18 '22 17:09 palmthree-studio

When I had upgraded to node 14.X it didn’t work for me. It worked only on node 12.x. You can try that or try installing node canvas separately as mostly that causes an issue.

mandys avatar Sep 18 '22 17:09 mandys

same issue with me..

rajatvermaiam avatar Sep 22 '22 10:09 rajatvermaiam

I think it's because the canvas dependency relies on a version of sharp that is broken in a lot of environments. From what I can tell, it doesn't look like canvas is being used anywhere, so I created a fork with canvas removed from package.json (https://github.com/creative-alchemy/tiktok-scraper/commit/6eff0ea4fce9370cbe85f1029f068630fdfdfb7b), and it appeared to install successfully after that.

If it's helpful, I can create a PR to suggest removing it.

arellaTV avatar Sep 30 '22 17:09 arellaTV

I have the same issue on node 18.10.0

Edit: I was able to install it by installing node v16.10.0 LTS

shifoc avatar Oct 10 '22 16:10 shifoc

Same issue in MacOS

nxfxcom avatar Nov 09 '22 15:11 nxfxcom

Same issue in MacOS

iaminnasr avatar Dec 31 '22 19:12 iaminnasr

Does anyone have a solution for MacOS? Or any alternative scraper to recommend?

Zabina avatar Jan 09 '23 08:01 Zabina

Message ID: @.***>I can tell you about a scraper that can get all TikToks of one account (in bulk) or what do you Need?

github-userx avatar Jan 09 '23 15:01 github-userx

@github-userx. I would need a TikTok scraper by hashtag. That would be awesome. Thank you in advance!

Zabina avatar Jan 09 '23 15:01 Zabina

Describe the bug Unable to install on Ubuntu mate 20.04.

If fields below will be empty then issue will be Ignored and Closed

To Reproduce Steps to reproduce the behavior:

  • Ubuntu Mate 20.04
  • NodeJs Version: v10.19.0
mate@mate:~$ sudo npm i -g tiktok-scraper
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: request-promise has been deprecated because it extends the now deprecated request pa
ckage, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circum
stances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
/usr/local/bin/tiktok-scraper -> /usr/local/lib/node_modules/tiktok-scraper/bin/cli.js

[email protected] install /usr/local/lib/node_modules/tiktok-scraper/node_modules/canvas
node-pre-gyp install --fallback-to-build --update-binary

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 ENOENT: no such file or directory, mkdir
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/tiktok-scraper/node_modules/canvas/build'
gyp ERR! System Linux 5.4.0-125-generic
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "configure" "--fallback-to-build" "--update-binary" "--module=/usr/local/l
ib/node_modules/tiktok-scraper/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/usr/local/
lib/node_modules/tiktok-scraper/node_modules/canvas/build/Release" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_vers
ion=0" "--node_napi_label=node-v64"
gyp ERR! cwd /usr/local/lib/node_modules/tiktok-scraper/node_modules/canvas
gyp ERR! node -v v10.19.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/bin/node-gyp configure --fallback-to-build --update-binary
--module=/usr/local/lib/node_modules/tiktok-scraper/node_modules/canvas/build/Release/canvas.node --module_name=canvas --modul
e_path=/usr/local/lib/node_modules/tiktok-scraper/node_modules/canvas/build/Release --napi_version=5 --node_abi_napi=napi --nap
i_build_version=0 --node_napi_label=node-v64' (1)
node-pre-gyp ERR! stack at ChildProcess.cmd.on (/usr/local/lib/node_modules/tiktok-scraper/node_modules/@mapbox/node-pre-gy
p/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 5.4.0-125-generic
node-pre-gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/tiktok-scraper/node_modules/.bin/node-pre-gyp" "install"
"--fallback-to-build" "--update-binary"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/tiktok-scraper/node_modules/canvas
node-pre-gyp ERR! node -v v10.19.0
node-pre-gyp ERR! node-pre-gyp -v v1.0.10
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/bin/node-gyp configure --fallback-to-build --update-binary --module=/usr/local/lib/node_m
odules/tiktok-scraper/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/usr/local/lib/node_modu
les/tiktok-scraper/node_modules/canvas/build/Release --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_l
abel=node-v64' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build --update-binary
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! /root/.npm/_logs/2022-09-17T18_06_10_086Z-debug.log
mate@mate-optiplex:~$

Try:

sudo apt-get update sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

and sudo npm i -g tiktok-scraper

BaGRoS avatar Jan 09 '23 22:01 BaGRoS