Failed [deploy : Run yarn install]

I have a working development environment setup. Now I am trying to deploy to my staging server but keep keep getting this message.

TASK [deploy : Run yarn install] ***********************************************
System info:
  Ansible 2.2.1.0; Darwin
  Trellis at "Allow for per-project packagist.com authentication"
---------------------------------------------------
[Errno 2] No such file or directory
fatal: [138.68.230.184]: FAILED! => {"changed": false, "cmd": "yarn install", "failed": true, "rc": 2}

This only happens when I edit build-before.yml.

If I comment everything out I am able to deploy no problem. Of course I don’t have any styling or anything for the theme. Is anyone else having this issue. I have searched through google and forum but cannot find anyone else with this issue.

This is my build-before.yml

# Placeholder `deploy_build_before` hook for building theme assets locally
# and then copying the files to the remote server
#
# Uncomment the lines below and replace `sage` with your theme folder
#
# ---
- name: Run yarn install
  command: yarn install
  connection: local
  args:
    chdir: "{{ project_local_path }}/web/app/themes/omni"

- name: Install Composer dependencies
  command: composer install --no-ansi --no-dev --no-interaction --no-progress --optimize-autoloader --no-scripts
  args:
    chdir: "{{ deploy_helper.new_release_path }}/web/app/themes/omni"

- name: Compile assets for production
  command: yarn run build:production
  connection: local
  args:
    chdir: "{{ project_local_path }}/web/app/themes/omni"

- name: Copy project local files
  synchronize:
    src: "{{ project_local_path }}/web/app/themes/omni/dist"
    dest: "{{ deploy_helper.new_release_path }}/web/app/themes/omni"
    group: no
    owner: no
    rsync_opts: --chmod=Du=rwx,--chmod=Dg=rx,--chmod=Do=rx,--chmod=Fu=rw,--chmod=Fg=r,--chmod=Fo=r

What version of Sage are you running?

I am currently using Sage 8.5.1

Ah, so you’re running the build-before.yml that is setup to work with Sage 9 i.e. using Yarn. You’ll instead want the Sage 8 version (Gulp etc.): https://github.com/roots/trellis/blob/bbb0c372db487b6d99387ae37e573ebe23c2806d/deploy-hooks/build-before.yml.

Ok interesting. Why would trellis have everything for sage 9 in the latest release. Is 9 even out yet?

Everything is working just fine now. Thank you for the help!

Ok interesting. Why would trellis have everything for sage 9 in the latest release. Is 9 even out yet?

Although Sage 9 is currently in beta, it is the master branch of Sage: https://github.com/roots/sage.

Everything is working just fine now. Thank you for the help!

Glad you’re up and running :slight_smile:

JESUS CHRIST THANK YOU!! have been trying to figure this out for days.

2 Likes

devs should consider putting a persist notification bar on docs site about incompatibility between roots elements during transition to new sage version. easier than trying to update docs in one swoop, and would help noobs, just a thought.

although I guess the fact that it was using yarn should have been a red flag. :blush:

1 Like