Sage 10 make-pot only on vagrant without yarn

I run yarn translate on my local dev in a Sage 10 multisite setup
here is the error about missing database connection:

$ run-s -c translate:*
$ wp i18n make-pot . ./resources/languages/sage.pot --ignore-domain --include="app,resources/assets,resources/views"
Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /www/site.com/site.com/web/wp/wp-includes/wp-db.php on line 1633

I also tried adding the --url parameter in the package.json file but the error does not change

If I’m not wrong wp-cli is not available outside trellis/vagrant and yarn is not available in vagrant.

I successfully run the command on the vagrant server without yarn:
wp i18n make-pot . ./resources/languages/sage.pot --ignore-domain --include="app,resources/assets,resources/views" --url=site.test

Should I add yarn support to trellis?

That doesn’t seem correct. That should be /srv/www/site.com/current if running trellis
& bedrock.

it is not the server path, it’s local and it’s fake, the real one point to the correct wp-db.php file

You aren’t wrong.

However, you can install wpcli on your host and set up an alias to your Vagrant box, though, which should allow you to run the command through yarn from your host: wp cli alias | WP-CLI Command | WordPress Developer Resources

1 Like

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