T
Termux4mo ago
MrSkraba

I'm having problems with Canvas, and can't install it.

Can anyone explain why it is so hard to download Canvas?
Solution:
``` pkg install x11-repo pkg install xorgproto nodejs export GYP_DEFINES="android_ndk_path=''" npm install canvas...
Jump to solution
37 Replies
MrSkraba
MrSkrabaOP4mo ago
@Rubinator someone please🙏 @CtrlAltCuteness please someone Sorry pings i can't really wait :3
Cuteness
Cuteness4mo ago
Let's take a step back. What is your end goal you are trying to achieve?
MrSkraba
MrSkrabaOP4mo ago
To download Canvas for my little welcome card API thing, it will be only for me tho. That nodejs canvas thing Not sure about those names but canvas it is called.
Cuteness
Cuteness4mo ago
Let me rephrase... What is the end goal you are trying to achieve? What is it that you need it for?
MrSkraba
MrSkrabaOP4mo ago
I need it for my welcome card, you know one of those things you see, welcome card for discord. (Image example) I got a code ready for it, but i can't use it if i dont have canvas.
No description
Cuteness
Cuteness4mo ago
Why are you making a bot to run on your phone anyways?
MrSkraba
MrSkrabaOP4mo ago
For fun, its easier becuase i dont have a pc I have created many bots in termux
Cuteness
Cuteness4mo ago
Nearly all npm / pip / etc. module that compiles native code normally needs to have source code changes made to it to work on Termux. First, check if a package for it already has been compiled.
MrSkraba
MrSkrabaOP4mo ago
So what do i do -# i am stupid 👍
Cuteness
Cuteness4mo ago
I guess you didn't read what I just typed?
MrSkraba
MrSkrabaOP4mo ago
Bc ^
Cuteness
Cuteness4mo ago
If you expect Linux to be as easy as Windows or Macintosh are, you are sadly mistaken.
MrSkraba
MrSkrabaOP4mo ago
Uhm okay
Cuteness
Cuteness4mo ago
Someone else could better phrase it than I could. Also note that being impatient is more likely to have less people here help you.
MrSkraba
MrSkrabaOP4mo ago
Sorry if i dont understand, may be because im not so good at english, could you please explain what do i need to do. I can give you the error message if that helps..?
MrSkraba
MrSkrabaOP4mo ago
@CtrlAltCuteness my error: https://pastebin.com/vrkaAJ2Y (can't post bc of discords caracter limit)
Pastebin
Code! - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Cuteness
Cuteness4mo ago
Package 'xproto', required by 'x11', not found
Is this inside OR outside of a proot? This seems to require the X11 (read: "desktop") environment. Also, this is trying to build a native library, which likely will not succeed as it isn't set up to be built for Termux. You are trying to compile code that is made for an ordinary Linux system, and Termux is not an ordinary Linux system.
MrSkraba
MrSkrabaOP4mo ago
I am running the npm install canvas command
Cuteness
Cuteness4mo ago
Check the next line of what it output... See the prebuild-install -r napi || node-gyp rebuild? It is trying to compile code.
MrSkraba
MrSkrabaOP4mo ago
Ohh
Cuteness
Cuteness4mo ago
This code needs to be patched to run on Termux... Also, further into your error, it shows stuff about X11...
MrSkraba
MrSkrabaOP4mo ago
What's X11? Do you know other packages to do this same? If this needs a lot of setup.
Cuteness
Cuteness4mo ago
First, I would like to take the chance to ask a question which may sound stupid, apologizes if so... do you know how to use the Linux command line / exit out of Vim / etc.? ^ @MrSkraba
MrSkraba
MrSkrabaOP4mo ago
No idea what you talking about? Why you asking this? Does is this related to my question?
Cuteness
Cuteness4mo ago
How to Termux - Learn your way around the terminal https://linuxjourney.com/lesson/the-shell - Getting started on Termux https://wiki.termux.com/wiki/Getting_started - Differences from a usual Linux distribution https://wiki.termux.com/wiki/Differences_from_Linux - Basics of Bash (the default shell) http://mywiki.wooledge.org/BashGuide/CommandsAndArguments - Bash cheatsheet https://devhints.io/bash
owokitty
owokitty4mo ago
@MrSkraba these commands worked for me, does this work for you? or is this a different thing from what you need?
Cuteness
Cuteness4mo ago
They are not doing so in a proot distro
Solution
owokitty
owokitty4mo ago
pkg install x11-repo
pkg install xorgproto nodejs
export GYP_DEFINES="android_ndk_path=''"
npm install canvas
pkg install x11-repo
pkg install xorgproto nodejs
export GYP_DEFINES="android_ndk_path=''"
npm install canvas
MrSkraba
MrSkrabaOP4mo ago
This worked for you?
owokitty
owokitty4mo ago
yes but i have a lot of stuff installed in termux
MrSkraba
MrSkrabaOP4mo ago
Alright
owokitty
owokitty4mo ago
you might need additional pkg install commands in addition to those if you see other errors
MrSkraba
MrSkrabaOP4mo ago
I Will try
Cuteness
Cuteness4mo ago
Also remember that you cannot use the sdcard, nor the shared "Internal Storage", for this stuff.
MrSkraba
MrSkrabaOP4mo ago
Yup
owokitty
owokitty4mo ago
well, you should be able to transfer files to and from Termux and your internal storage by using the /storage/emulated/0 folder after using termux-setup-storage. but it's a bit easier to just do everything using the Termux folder
MrSkraba
MrSkrabaOP4mo ago
Thank you! I will try my main code now.

Did you find this page helpful?