# Deploy_build_before - Yarn, No such file or directory

**URL:** https://discourse.roots.io/t/deploy-build-before-yarn-no-such-file-or-directory/20222
**Category:** bedrock
**Tags:** deploys
**Created:** 2021-02-26T20:11:11Z
**Posts:** 7

## Post 1 by @ejayrus — 2021-02-26T20:11:11Z

Hi Guys,  
My first project in trellis/bedrock/sage.  
I’m seeing this error when I deploy the website to staging droplet.

```
TASK [deploy : Check if deploy_build_before scripts exist] *********************************************************************************************************
ok: [xxx.xxx.xxx.xxx] => (item=/home/theusername/sites/bf/trellis/deploy-hooks/build-before.yml)

TASK [deploy : include_tasks] **************************************************************************************************************************************
included: /home/theusername/sites/bf/trellis/deploy-hooks/build-before.yml for xxx.xxx.xxx.xxx => (item={'changed': False, 'stat': {'exists': True, 'path': '/home/theusername/sites/bf/trellis/deploy-hooks/build-before.yml', 'mode': '0664', 'isdir': False, 'ischr': False, 'isblk': False, 'isreg': True, 'isfifo': False, 'islnk': False, 'issock': False, 'uid': 1000, 'gid': 33, 'size': 1206, 'inode': 1932424, 'dev': 2068, 'nlink': 1, 'atime': 1614366936.9876294, 'mtime': 1614366857.61879, 'ctime': 1614366857.61879, 'wusr': True, 'rusr': True, 'xusr': False, 'wgrp': True, 'rgrp': True, 'xgrp': False, 'woth': False, 'roth': True, 'xoth': False, 'isuid': False, 'isgid': False, 'blocks': 8, 'block_size': 4096, 'device_type': 0, 'readable': True, 'writeable': True, 'executable': False, 'pw_name': 'theusername', 'gr_name': 'www-data', 'checksum': '17e584f6d6663d81441eb19d8e62d8f2e327b7c0', 'mimetype': 'text/plain', 'charset': 'utf-8', 'version': '1984101045', 'attributes': ['extents'], 'attr_flags': 'e'}, 'invocation': {'module_args': {'path': '/home/theusername/sites/bf/trellis/deploy-hooks/build-before.yml', 'follow': False, 'get_md5': False, 'get_checksum': True, 'get_mime': True, 'get_attributes': True, 'checksum_algorithm': 'sha1'}}, 'failed': False, 'item': '/home/theusername/sites/bf/trellis/deploy-hooks/build-before.yml', 'ansible_loop_var': 'item'})

TASK [deploy : Install npm dependencies] ***************************************************************************************************************************
System info:
  Ansible 2.10.6; Linux
  Trellis version (per changelog): "Remove prestissimo for Composer 2.0 support"
---------------------------------------------------
[Errno 2] No such file or directory: b'yarn'
fatal: [xxx.xxx.xxx.xxx]: FAILED! => {"changed": false, "cmd": "yarn", "rc": 2}

PLAY RECAP *********************************************************************************************************************************************************
xxx.xxx.xxx.xxx : ok=12 changed=4 unreachable=0 failed=1 skipped=25 rescued=0 ignored=0   
localhost : ok=0 changed=0 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0
```

The trellis/deploy-hooks/build-before.yml starts as follows

```
---
- name: Install npm dependencies
  command: yarn
  delegate_to: localhost
  args:
    chdir: "{{ project_local_path }}/web/app/themes/mb"
```

In my virtual machine, `which yarn` results in nothing so yarn is not installed inside the VM.

Any help resolving this will be greatly appreciated.  
Thanks.

---

## Post 2 by @alwaysblank — 2021-02-26T20:20:43Z

Yarn is run in the same environment as ansible, which is usually the host (not the guest). Do you have yarn installed in the same environment where you run the Trellis depot script?

---

## Post 3 by @ejayrus — 2021-02-26T20:23:19Z

No, not installed on my development machine either.

---

## Post 4 by @alwaysblank — 2021-02-26T20:29:49Z

Then install yarn on your development machine.

---

## Post 5 by @ejayrus — 2021-02-26T20:31:54Z

Great. Such a stupid mistake :smiley:

Question, did I miss this step in trellis docs? And do I need to install any specific version or the latest one will do?

Thanks for your quick replies :slight_smile:

---

## Post 6 by @ejayrus — 2021-02-26T20:46:48Z

It is right there [https://roots.io/docs/getting-started/ubuntu-linux/#working-with-sage](https://roots.io/docs/getting-started/ubuntu-linux/#working-with-sage)

Cannot believe I missed it. Thanks a lot for you QUICK responses.

Cheers.

---

## Post 7 by @system — 2021-04-09T20:11:16Z

This topic was automatically closed after 42 days. New replies are no longer allowed.
