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

Windows System Fix #9

Open
Jouveer opened this issue Jul 11, 2019 · 10 comments
Open

Windows System Fix #9

Jouveer opened this issue Jul 11, 2019 · 10 comments
Labels

Comments

@Jouveer
Copy link

Jouveer commented Jul 11, 2019

After trying to get the bot to work with windows, I seem to have found a solution where everything I have tested is working.

Bot setup instructions Windows 10:

1. Install Ubuntu
Execute this command and restart PC.
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
1b. Download Ubuntu from Microsoft Store and install

Run the following commands through Ubuntu

2. Update
sudo apt-get update
sudo apt-get upgrade

3. Install NodeJS
sudo apt-get install curl python-software-properties
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install nodejs

4.Install GCC through build-tools
sudo apt install build-essential

5.Install Node-gyp
sudo npm install -g node-gyp

6.Create a discord bot
https://discordapp.com/developers/applications/

7.Create osu! API Key
https://osu.ppy.sh/p/api/

8.Install .NET SDK
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo add-apt-repository universe
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-2.2

If you are unable to locate the package:
sudo dpkg --purge packages-microsoft-prod && sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install dotnet-sdk-2.2

9.Install Node Canvas
sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
npm install canvas

10.Clone Repository and build
cd
git clone https://github.com/LeaPhant/flowabot.git

If you want PP command:
cd
git clone --recurse-submodules https://github.com/ppy/osu-tools
cd osu-tools/
sudo ./build.sh

11.Set Up Bot
cd
cd flowabot
npm i
npm run config
Set up the bot how you would like, using your discord bot info and osu! API Key.
Performance calculator dll should be located at:
/home/**YOUR USER**/osu-tools/PerformanceCalculator/bin/Release/netcoreapp2.0/PerformanceCalculator.dll

12.Set Up Emojis
Let bot join your server:
https://discordapp.com/api/oauth2/authorize?client_id=**YOUR-CLIENT-ID**&permissions=8&scope=bot
Still within flowabot directory:
npm run emojis
The server index should be 0 if the bot is only on 1 server.

13.Start Bot
npm start

If anything is not working then I will try to help, the guide is just written from memory so I may have forgotten something.
File system is located at:
C:\Users\**USER**\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs

This was referenced Jul 11, 2019
@LeaPhant
Copy link
Owner

Thank you for this, I will link this in the README if it's ok cause I don't really want to work on Windows support.

@Jouveer
Copy link
Author

Jouveer commented Jul 11, 2019

No problem,
Sure, you can add it to the README if you'd like.

@LeaPhant LeaPhant added the guide label Jul 11, 2019
@davson19
Copy link

Tried this and it went well until I tried to install canvas, got hit with some permission errors but adding --unsafe-perm=true at the end of sudo npm install canvas made it run. Then cloning gave a couple warnings about permissions, and npm i just doesn't work (apparently an issue w/ npm intself)

@Jouveer
Copy link
Author

Jouveer commented Jul 11, 2019

If you send a screenshot of the error message then I can try to help. I may have forgotten something in the instructions so will try to pinpoint what it is if I have.

@davson19
Copy link

Sure thing.
This is what I got trying to install canvas.
However running it with the --unsafe-perm=true gave me this, which looks a lot better.
Cloning the osu-tools repo gives me this warning, although building it ran fine. Trying to clone flowabot gave me the same warning
Finally running npm i gives me a massive list of permission denied errors, culminating in an error saying cb() never called!.
I tried to see if sudo npm i would be any different, and it ended up looking like this generating this and this in the error log (had to split it up bc pastebin size limitations).
Anything else you might need lmk. Appreciate your help a ton :)

@Jouveer
Copy link
Author

Jouveer commented Jul 11, 2019

@davson19
Try this in the home user directory of Ubuntu
sudo mkdir ~/.npm-global
sudo npm config set prefix '~/.npm-global'
source ~/.profile

Then try to install canvas again

Delete the broken clones
If the build went fine then you probably don’t need to do this, you can try it to be sure if you want

sudo rm -rf flowabot/
sudo rm -rf osu-tools/
sudo chown -R $(whoami) .config
Then try to clone repos again
Build osu-tools if you deleted it anyway

Tell me if that works for you, think I faced the same issue but thought it wasn’t a nessessary step for everyone.
Will update the guide if this works for you

@davson19
Copy link

No luck sadly, and trying to use sudo didnt work either

@Jouveer
Copy link
Author

Jouveer commented Jul 12, 2019

What does this return?
find ~/node_modules/ -printf '%u\n' | sort -t: -u

If there is anything besides your user listed then try to do
sudo rm -rf node_modules/
npm install -g node-gyp without sudo
npm install canvas without sudo

@davson19
Copy link

Only root gets printed

@Jouveer
Copy link
Author

Jouveer commented Jul 12, 2019

Try sudo chown -R $(whoami) node_modules/
Then make sure other installations are correct with
npm install -g node-gyp without sudo
npm install canvas without sudo

When I run the command I get my user account as owner, not root.
Hopefully setting the ownership to you will fix the permission error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants