-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wp-env - Unable to install WordPress CLI Packages #32784
Comments
I've tried the same command and I saw the same error. $ wp-env run cli package install 10up/mu-migration
ℹ Starting 'package install 10up/mu-migration' on the cli container.
Creating d0b5cd3d272c8fd42f784483dc906a37_cli_run ... done
Error: Composer directory '/etc/X11/fs/.wp-cli/packages' for packages couldn't be created: mkdir(): Permission denied
ERROR: 1
✖ Command failed with exit code 1
Command failed with exit code 1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. And I think there is no directory. % wp-env run cli "ls -la /etc/X11"
Creating d0b5cd3d272c8fd42f784483dc906a37_cli_run ... done
ls: /etc/X11: No such file or directory
ERROR: 1
✖ Command failed with exit code 1
Command failed with exit code 1 Probably the |
One solution could be to change the packages directory to a writable path by setting the environment variable It looks like though there is no way to set new environment variables when setting up the docker-compose - gutenberg/packages/env/lib/build-docker-compose-config.js Lines 222 to 225 in b332c75
|
Is it possible to inject value like this?
|
I could install the extension by setting the env variable like above by directly accessing
But the same did not work when trying the
Notice it misses the To fix this I think Also, maybe it would be nice to add more environment variables from |
@Nikschavan agree — passing custom environment variables via Wondering if a PR would be accepted for adding such a capability |
Has anyone figured out a solution to this? I tried putting quotation marks around the run command with an -e flag for WP_CLI_PACKAGES_DIR but it just hangs on creating the container.
|
Description
wp-env Docker environment is unable to install new WordPress CLI packages due to a permission denied issue.
Step-by-step reproduction instructions
Expected behaviour
The package should be installed and ready to be used via WordPress CLI.
Actual behaviour
An error occurs: Error: Composer directory '/etc/X11/fs/.wp-cli/packages' for packages couldn't be created: mkdir(): Permission denied
Screenshots or screen recording (optional)
WordPress information
Device information
The text was updated successfully, but these errors were encountered: