# How can we compile filbeat code in windows or linux?

**URL:** <https://discuss.elastic.co/t/how-can-we-compile-filbeat-code-in-windows-or-linux/159362>\
**Category:** Beats\
**Created:** [December 4, 2018, 1:32pm UTC](https://discuss.elastic.co/t/how-can-we-compile-filbeat-code-in-windows-or-linux/159362 "2018-12-04T13:32:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![talbehat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/talbehat/32/84367_2.png) [@talbehat](https://discuss.elastic.co/u/talbehat)\
**Post date:** [December 4, 2018, 1:32pm UTC](https://discuss.elastic.co/t/how-can-we-compile-filbeat-code-in-windows-or-linux/159362/1 "2018-12-04T13:32:53Z")

</div>

Please help me ?

Getting Error :

PS C:\Users\shubham.jain\Downloads\beats-6.4.2\beats-6.4.2\filebeat\> go build

main.go:23:2: cannot find package "[github.com/elastic/beats/filebeat/cmd](http://github.com/elastic/beats/filebeat/cmd)" in any of:  
C:\Go\src\[github.com](http://github.com)\elastic\beats\filebeat\cmd (from $GOROOT)  
C:\Users\shubham.jain\go\src\[github.com](http://github.com)\elastic\beats\filebeat\cmd (from $GOPATH)

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [December 4, 2018, 2:46pm UTC](https://discuss.elastic.co/t/how-can-we-compile-filbeat-code-in-windows-or-linux/159362/2 "2018-12-04T14:46:16Z")

</div>

Looks like you do not have the beats project on your GOPATH. [https://www.elastic.co/guide/en/beats/devguide/current/beats-contributing.html#setting-up-dev-environment](https://www.elastic.co/guide/en/beats/devguide/current/beats-contributing.html#setting-up-dev-environment)

The `beats` directory needs to be found at `%GOPATH%\src\github.com\elastic\beats` where GOPATH is the value returned from `go env GOPATH`.

---

<div class="post-metadata">

**Author:** ![talbehat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/talbehat/32/84367_2.png) [@talbehat](https://discuss.elastic.co/u/talbehat)\
**Post date:** [December 5, 2018, 8:49am UTC](https://discuss.elastic.co/t/how-can-we-compile-filbeat-code-in-windows-or-linux/159362/3 "2018-12-05T08:49:52Z")

</div>

Thanks, @[andrewkroh](https://discuss.elastic.co/u/andrewkroh)

Please suggest me how many project need to commit code in my local repository.

Have i to commit code full (golang src + libbeat + filebeat + vendor) in my local repository?

is there any go build management tool to do that, or will need to same ? manually will have to add these folder inside golang src.

Please help.

---

<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:** [January 2, 2019, 10:59am UTC](https://discuss.elastic.co/t/how-can-we-compile-filbeat-code-in-windows-or-linux/159362/4 "2019-01-02T10:59:26Z")

</div>

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