Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
- Home
- General
- Liferay Learn Feedback
- RE: Installing and Updating Blade CLI document doesn't actually install Blade
RE: Installing and Updating Blade CLI document doesn't actually install Blade
The documents:
https://learn.liferay.com/w/dxp/liferay-development/tooling/blade-cli/installing-and-updating-blade-cli
and https://learn.liferay.com/w/dxp/liferay-development/tooling/blade-cli/troubleshooting-blade-cli#the-blade-command-is-not-available-in-my-cli
claims to describe installing Blade CLI using a curl | sh command.
But, doing so doesn't actually successfully install Blade CLI in a
working state.
Context:
I'm trying to create a Liferay workspace to generate a
sample project, but since the documentation describing how to get a
Liferay workspace is poor to the point of being unusable, I'm
attempting to install Blade and use it to generate a Liferay
workspace. But, even that doesn't seem to work.
My use case:
- Run a Docker container with docker run -it --name liferay-workspace eclipse-temurin:8u352-b08-jdk
- Run the curl -L ... | sh command from the documentation
- The message says blade (small b) installed successfully, but attempting to run Blade commands shows "command not found"
- Run the echo >> bash command from the documentation
- attempting to run Blade commands still shows "command not found"
- Restart the container
- attempting to run blade commands still shows "command not found"
Hi Kevin, I've followed these steps recently in my own system, and they worked. I have openjdk installed locally though. So it might be some issue unique to your setup. Why not just install the JDK on your developer machine?
Re the troubleshooting information in the documentation that you link: This adds the executable to the shell's path, but only for the next shell to be started that reads this file. Otherwise you can run "source .bash_profile" (if I'm not mistaken).
Or execute blade with an explicit path, for the time being.
Also, I don't expect that change to survive a docker container restart. After all, the container is meant to be immutable.
Hi Kevin, thanks for bringing this to our attention. It looks like the image you are using does not source the .bash_profile by default, so the changes to the PATH according to the troubleshooting page won't have any effect unless you explicitly call "source ~/.bash_profile". An alternative could be to modify the command from that page to target the .bashrc file, which does appear to be sourced by the shell automatically. So the command would look like this:
echo 'export PATH="$PATH:$HOME/jpm/bin"' >> ~/.bashrc
In my local testing, I tried that command and re-started the container, and blade was found.
Would you be willing to try that and see if it works?
Powered by Liferay™