# Error on make setup

**URL:** <https://discuss.elastic.co/t/error-on-make-setup/147473>\
**Category:** Beats\
**Tags:** beats-development\
**Created:** [September 5, 2018, 8:42pm UTC](https://discuss.elastic.co/t/error-on-make-setup/147473 "2018-09-05T20:42:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnZot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anzot/32/35270_2.png) [@AnZot](https://discuss.elastic.co/u/AnZot)\
**Post date:** [September 5, 2018, 8:42pm UTC](https://discuss.elastic.co/t/error-on-make-setup/147473/1 "2018-09-05T20:42:00Z")

</div>

Hi, I'm trying to create a new beat by using this guide - [https://www.elastic.co/guide/en/beats/devguide/6.4/new-beat.html](https://www.elastic.co/guide/en/beats/devguide/6.4/new-beat.html)  
After I generated my beat and trying to setup it with 'make setup' command I received this error:  
zotan$ make setup  
mkdir -p vendor/github.com/elastic  
cp -R /Users/zotan/Projects/go/src/github.com/elastic/beats vendor/github.com/elastic/  
rm -rf vendor/github.com/elastic/beats/.git vendor/github.com/elastic/beats/x-pack  
mkdir -p vendor/github.com/magefile  
cp -R /Users/zotan/Projects/go/src/github.com/elastic/beats/vendor/github.com/magefile/mage vendor/github.com/magefile  
git init  
Reinitialized existing Git repository in /Users/zotan/Projects/go/src/github.com/zotan/mysqlbeat/.git/  
go install [github.com/zotan/mysqlbeat/vendor/github.com/magefile/mage](http://github.com/zotan/mysqlbeat/vendor/github.com/magefile/mage)  
make: [mage] Error 127 (ignored)  
bash: mage: command not found  
make: \*\*\* [fields] Error 127  
I tried to do this on the different machine (with Ubuntu) and received the exact same error. Could anyone help me please with that?

---

<div class="post-metadata">

**Author:** ![adrisr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adrisr/32/25423_2.png) [@adrisr](https://discuss.elastic.co/u/adrisr)\
**Post date:** [September 5, 2018, 10:02pm UTC](https://discuss.elastic.co/t/error-on-make-setup/147473/2 "2018-09-05T22:02:47Z")

</div>

It seems the guide needs to be updated or the `mage` dependency installed automatically.

As a workaround, you can install it yourself:

```
go get github.com/magefile/mage
```

---

<div class="post-metadata">

**Author:** ![AnZot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anzot/32/35270_2.png) [@AnZot](https://discuss.elastic.co/u/AnZot)\
**Post date:** [September 6, 2018, 1:20pm UTC](https://discuss.elastic.co/t/error-on-make-setup/147473/3 "2018-09-06T13:20:39Z")

</div>

Unfortunately this did not help:

azotin@azotin:~/go/src/github.com/azotin/mysqlbeat$ go get [github.com/magefile/mage](http://github.com/magefile/mage)  
azotin@azotin:~/go/src/github.com/azotin/mysqlbeat$ make setup  
mkdir -p vendor/github.com/elastic  
cp -R /home/azotin/go/src/github.com/elastic/beats vendor/github.com/elastic/  
rm -rf vendor/github.com/elastic/beats/.git vendor/github.com/elastic/beats/x-pack  
mkdir -p vendor/github.com/magefile  
cp -R /home/azotin/go/src/github.com/elastic/beats/vendor/github.com/magefile/mage vendor/github.com/magefile  
go install [github.com/azotin/mysqlbeat/vendor/github.com/magefile/mage](http://github.com/azotin/mysqlbeat/vendor/github.com/magefile/mage)  
vendor/github.com/elastic/beats/libbeat/scripts/Makefile:441: recipe for target 'mage' failed  
make: [mage] Error 127 (ignored)  
bash: mage: command not found  
vendor/github.com/elastic/beats/libbeat/scripts/Makefile:308: recipe for target 'fields' failed  
make: \*\*\* [fields] Error 127  
azotin@azotin:~/go/src/github.com/azotin/mysqlbeat$

---

<div class="post-metadata">

**Author:** ![adrisr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adrisr/32/25423_2.png) [@adrisr](https://discuss.elastic.co/u/adrisr)\
**Post date:** [September 6, 2018, 1:41pm UTC](https://discuss.elastic.co/t/error-on-make-setup/147473/4 "2018-09-06T13:41:40Z")

</div>

Try adding $GOPATH/bin to your $PATH:

```
export PATH="$GOPATH/bin:$PATH"

```

If GOPATH is not set, then use `~/go/bin`

---

<div class="post-metadata">

**Author:** ![AnZot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anzot/32/35270_2.png) [@AnZot](https://discuss.elastic.co/u/AnZot)\
**Post date:** [September 6, 2018, 1:49pm UTC](https://discuss.elastic.co/t/error-on-make-setup/147473/5 "2018-09-06T13:49:48Z")

</div>

It helped, thank you)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 4, 2018, 1:49pm UTC](https://discuss.elastic.co/t/error-on-make-setup/147473/6 "2018-10-04T13:49:49Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
