louisgrasset / touitomamout

Touitomamout is an easy way to synchronize your Twitter's tweets 🦤 to Mastodon 🦣 and Bluesky post ☁️ (also known as Twitter to Mastodon & Bluesky crossposter)
https://hub.docker.com/r/louisgrasset/touitomamout
GNU Affero General Public License v3.0
133 stars 7 forks source link

Unable to build in PM2 #155

Closed flatlinee closed 9 months ago

flatlinee commented 10 months ago

Describe the bug Can't build with PM2. Gives me this error:

C:\Users\Neil.pm2\home\Neil\services\touitomamout>npm run pm2

touitomamout@1.6.3 pm2 bash deployment/pm2.sh

deployment/pm2.sh: line 2: $'\r': command not found deployment/pm2.sh: line 5: $'\r': command not found deployment/pm2.sh: line 7: $'\r': command not found deployment/pm2.sh: line 9: syntax error near unexpected token $'do\r'' 'eployment/pm2.sh: line 9:for env in .env*; do

To Reproduce Run npm run pm2

I had to install some linux distribution to even make the bash script work, which wasn't mentioned in the tutorial at all, and I also have no idea how to "inject the .env file" as mentioned in the tutorial as well. It's really not written for beginners and just doesn't include commands sometimes.

louisgrasset commented 10 months ago

You are running in a issue related to the fact you are trying to run the project under a Windows environment.

The line 2: $'\r': command not found error comes from windows not handling files the same way linux/macos do. I suggest you to jump into one of the first StackOverflow answers to fix this: https://stackoverflow.com/search?q=%24%27%5Cr%27%3A+command+not+found&s=a99237f6-81c9-474f-bd72-394f5e28cced

Regarding the fact you had to install the WSL (Windows Subsystem for Linux), well, to be honest I did not test the deployment on a windows machine, sorry for that.

Let me know how's your debugging session goes with the CRLF/LF issue, I'll be happy to fix any issue in the code 🌟