Deploy_build_before - Yarn, No such file or directory

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.

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?

No, not installed on my development machine either.

Then install yarn on your development machine.

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:

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

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

Cheers.

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