blade-generate
blade-generate copied to clipboard
Package doesn't install with `wp package install [email protected]:alwaysblank/blade-generate.git`
The Error
Composer errors out while trying to install blade-generate with the supplied installation command,
# wp package install [email protected]:alwaysblank/blade-generate.git
Error output:
# wp package install [email protected]:alwaysblank/blade-generate.git
Installing package alwaysblank/blade-generate (dev-master)
Updating /home/user/.wp-cli/packages/composer.json to require the package...
Registering [email protected]:alwaysblank/blade-generate.git as a VCS repository...
Using Composer to install the package...
---
Loading composer repositories with package information
Updating dependencies
Reverted composer.json.
WP-CLI ran out of memory. Please see https://bit.ly/wpclimem for further help.
Replicating the Error
This happened to me on my local macOS and Ubuntu environments, and also my remote Debian environment. The solutions listed at https://bit.ly/wpclimem all seem to deal with memory allocation, but none of them worked for me.
I also tried downloading the package and trying the different options the wp package install
command offers:
wp package install <name|git|path|zip>
None of those worked.
Solution?
Finally, I tried installing it to WP-CLI "manually", by requiring the package in ~/.wp-cli/packages/composer.json
and adding the GitHub repo as a repository:
{
"require": {
"alwaysblank/blade-generate": "dev-master"
},
"repositories": {
"wp-cli": {
"type": "composer",
"url": "https://wp-cli.org/package-index/"
},
"alwaysblank/blade-generate": {
"type": "vcs",
"url": "https://github.com/alwaysblank/blade-generate.git"
},
},
Composer returned this lint error:
# composer install
Loading composer repositories with package information
Reading composer.json of alwaysblank/blade-generate (refactor-standards)
Skipped branch refactor-standards, "a2dd1ed3ab743fa933ca2dfaadc507fd665d20d2:composer.json" does not contain valid JSON
Parse error on line 10:
...mand.php" ] "" }, "requi
---------------------^
Expected one of: 'EOF', '}', ',', ']'
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
- Installing symfony/finder (v2.7.0): Downloading (100%)
- Installing alwaysblank/blade-generate (dev-master 876d495): Cloning 876d49514c from cache
Writing lock file
Generating autoload files
However, the package installed and seems to work okay, so I'm not sure if that error is related to the installation?
# wp blade compile
Finding files...
Compiling templates 100% [========================================] 0:00 / 0:00
Success: Templates rendered!
Finally, a funny story: I was trying to install this package because I was getting a white screen of death on certain pages after pushing new templates for them up to my staging server. After taking a detour to try all the above and get it working, I realized that the real reason the templates weren't rendering was because I forgot to save my work and had uploaded empty template files to the server. 🤣
Getting the same error. I'm also getting a memory max on the alternative posted above.
Got the same error with the memory limit. https://bit.ly/wpclimem — didn't help.
What helped for me (general issue):
- Determine the path to the packages folder:
wp package path
-
cd
to that path - There is a
composer.json
in that directory, it also has already been updated bywp package install [...]
. - Invoke
composer update
, in my case it didn't hang and installed fine.
For me, from running wp package install [email protected]:alwaysblank/blade-generate.git
I got this error:
Installing package alwaysblank/blade-generate (dev-master)
Updating /Users/user/.wp-cli/packages/composer.json to require the package...
Registering [email protected]:alwaysblank/blade-generate.git as a VCS repository...
Using Composer to install the package...
---
Loading composer repositories with package information
Updating dependencies
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in phar:///usr/local/bin/wp/vendor/composer/composer/src/Composer/Json/JsonFile.php on line 272
Reverted composer.json.
I got it to work with the instructions in https://github.com/wp-cli/package-command/issues/69. Basically installed with the command php -d memory_limit=2024M "$(which wp)" package install [email protected]:alwaysblank/blade-generate.git
. However, trying to run wp blade clear
gives Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in .../site/web/wp/wp-includes/wp-db.php on line 1635
, this might be completely unrelated though.