'Code-Server will not start on Raspberry Pi 4

I’m trying to set up code-server to use VS Code on my iPad through my Raspberry Pi. I’ve been following this guide on GitHub: https://github.com/andreivisan/Raspberry-Pi-4-Code-Server

but I haven’t been able to get it to work. I’ve double and triple-checked each step multiple times for the code-server setup but I always end up with the same error:

code-server.service - code-server
     Loaded: loaded (/lib/systemd/system/code-server.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2022-02-22 17:25:57 AEST; 32s ago
   Main PID: 6601 (code=exited, status=203/EXEC)
        CPU: 6ms

Feb 22 17:25:57 raspberrypi systemd[1]: code-server.service: Scheduled restart job, restart counter is at 5.
Feb 22 17:25:57 raspberrypi systemd[1]: Stopped code-server.
Feb 22 17:25:57 raspberrypi systemd[1]: code-server.service: Start request repeated too quickly.
Feb 22 17:25:57 raspberrypi systemd[1]: code-server.service: Failed with result 'exit-code'.
Feb 22 17:25:57 raspberrypi systemd[1]: Failed to start code-server. 

I understand that it’s exiting after too many failed restart attempts, but I can’t figure out why it won’t start in the first place. Any help is greatly appreciated!!



Solution 1:[1]

So it turned out I had the pathing incorrect from how it installed via yarn.I just needed to change my path in my code-server.service file from code-server (For some this may be /usr/local/bin/code-server) to /home/pi/.yarn/bin/code-server and now it works.

Best way to know is to check the path extension code-server tells you after it has been installed.

However, still facing an issue of finding a 404 page when i try to route to my Pi’s IP address on the 8080 port in safari, but that’s a separate issue to this one.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 LJ-03