pmgo icon indicating copy to clipboard operation
pmgo copied to clipboard

FATA[0000] Failed to start go bin due to: ERROR: chdir ...: no such file or directory OUTPUT

Open srad opened this issue 3 years ago • 4 comments

Hi, I'm Currently switching from Node's pm2 to pmgo. It seems obviously named after pm2 but seems to work differently.

I installed it the second way described in the readme.

When I then exactly follow what's written in the readme:

pmgo start path/to/source-directory app-name

Also without the leading slash, ablsolute, relative path, whatever, I get following error message and wrongly changed path which I didn't specify:

FATA[0000] Failed to start go bin due to: ERROR: chdir /src/path/to/source-directory: no such file or directory OUTPUT:  

To any path "/src" prefix is added, anybody an idea what is going on?

srad avatar Aug 07 '21 09:08 srad

hey are you trying to run a compiled binary?

if so add true at the end, pmgo start path/to/source-directory app-name true

hopefully this saves you the three hours i spent trying to figure it out ❤️

Looskie avatar Sep 27 '21 02:09 Looskie

The below steps worked for me.

  1. By default my $GOPATH was $HOME/go ( /root/go )

  2. After we have our go path set, do

go get github.com/struCoder/pmgo

  1. Then do mv $GOPATH/bin/pmgo /usr/local/bin

  2. After that we navigate to /root/go/ and make sure you have a src directory in there, if not create one.

  3. Move your directory(where your code lives) eg. in my case my main.go was in a directory named test, so I did

mv /root/test $HOME/src

  1. Then do pmgo start test app-name

Hope it works for you too.

tech-engine avatar Oct 05 '21 03:10 tech-engine

not at all working

shailesh-flowace avatar Apr 26 '22 10:04 shailesh-flowace

Another way it worked for me.

My env values

$GOPATH = /home/joe/go

please make sure that you the below set

export GOPATH=$HOME/go

whenever we type the command

pmgo start my_project my-app

it seems to try to find my_project dir inside $HOME/go/src

Download and build pmgo

1. cd /home/joe
2. git clone https://github.com/struCoder/pmgo.git
3. cd pmgo
4. go build -v pmgo.go
5. mv pmgo /usr/local/bin
6. pmgo version

Copying our source code to appropriate dir so that pmgo can find it.

Now that we have pmgo installed we need to copy your source code to /home/joe/go/src

7. cd /path/to/source/my_project
8. cp -R . /home/joe/go/src/my_project
9. pmgo start my_project my-app

Done.

tech-engine avatar Sep 21 '22 03:09 tech-engine