Error: sed not present, please install sed
-
I have finally got WP CLI working (by adding each missing path manually - Laragon does NOT manage PATH at least not for me it seems, despite what is said elsewherehere).
Now when running wp mu-migration I get
Error: sed not present, please install sed
How do I install SED please?
-
@patbell101 : I answered your question here:
https://forum.laragon.org/topic/1039/tutorial-how-to-add-wp-cli-to-laragonIf you don't fix the
init.bat
issue, you will face other nuisances.
-
@patbell101 : After fixing the terminal issue, you can add
sed
easily by clicking Menu > Tools > Quick add > git
-
@leokhoa I reinstalled laragon (which I presume you meant) and no longer get the init.bat error but I still get the sed error for my OP
So I ask again - how do I install SED?
and/or what does the undefined index error mean?
-
@patbell101 : Did you read my instruction and follow?
@leokhoa said in Error: sed not present, please install sed:@patbell101 : After fixing the terminal issue, you can add sed easily by clicking Menu > Tools > Quick add > git
-
I have added git as you instructed before but still get the message about sed. I have refollowed all the wpcli implementation instructions and your additional ones too.
fwiw I have reinstalled over and reinstalled git. Looking at the laragon path in tools shows an entry C:\laragon\bin\git\usr\bin which is where SED resides. So its in the path and typing SED on its own shows no problem. Is this a problem with MU-MIGRATION then? Which is the only reason I want WP-CLI at all.
-
@patbell101 : I guess so. If you want to make sure, you can check its source code.
-
@leokhoa - looking on git I can see that the function that erroneously generates the error is as copied below. My coding skills do not enable me to figure out the problem nor comment out and install an edited package. Perhaps you can understand the function sufficiently to advise a fix on the laragon end of things?
/**
* Checks whether sed is available or not.
*
* @param bool $exit_on_error If set to true the script will be terminated if sed is not available.
* @return bool
*/
private function check_for_sed_presence( $exit_on_error = false ) {
$sed = \WP_CLI::launch( 'echo "wp_" | sed "s/wp_/wp_5_/g"', false, true );
if ( 'wp_5_' !== trim( $sed->stdout, "\x0A" ) ) {
if ( $exit_on_error ) {
\WP_CLI::error( __( 'sed not present, please install sed', 'mu-migration' ) );
}
return false;
}
return true;
}
}