# How to fix TypeError : Cant compile non template nodes While running ansible-test

**URL:** <https://forum.ansible.com/t/how-to-fix-typeerror-cant-compile-non-template-nodes-while-running-ansible-test/36201>\
**Category:** Ansible Developer\
**Tags:** ubuntu\
**Created:** [January 14, 2022, 10:53am UTC](https://forum.ansible.com/t/how-to-fix-typeerror-cant-compile-non-template-nodes-while-running-ansible-test/36201 "2022-01-14T10:53:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![selvigp](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/selvigp/32/4977_2.png) [@selvigp](https://forum.ansible.com/u/selvigp)\
**Post date:** [January 14, 2022, 10:53am UTC](https://forum.ansible.com/t/how-to-fix-typeerror-cant-compile-non-template-nodes-while-running-ansible-test/36201/1 "2022-01-14T10:53:19Z")

</div>

Hey,

I have used Ubuntu 18.04 LTS and installed ansible 2.9.27 and python 2.7.17. I am going to test ansible-collection with the ansible-test command. When I give “ansible-test unit” , I am getting the below error. Kindly help me to fix this error.

 ![Error.png](https://us1.discourse-cdn.com/ansible/original/2X/7/7f08d665550c47ca5c0ebe42a332045b242f2fde.png)

Thanks,  
Selvi

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [January 16, 2022, 11:34am UTC](https://forum.ansible.com/t/how-to-fix-typeerror-cant-compile-non-template-nodes-while-running-ansible-test/36201/2 "2022-01-16T11:34:03Z")

</div>

Hi,

> I have used Ubuntu 18.04 LTS and installed ansible 2.9.27 and python  
> 2.7.17. I am going to test ansible-collection with the ansible-test  
> command. When I give "ansible-test unit" , I am getting the below  
> error. Kindly help me to fix this error.

I'm not sure where this error comes from (looks like a bug to me), but  
you have to run `ansible-test unit` in a correct path structure. The  
current working directory must be of the form  
`.../ansible_collections/\<namespace\>/\<collection\>/`, where the  
collection you are working on is `\<namespace\>.\<collection\>`.

> [image: Error.png]

Please note that providing error messages only in screenshots is a very  
bad idea.

Cheers,  
Felix
