Setting your development environment

May 22, 2024

Prerequisites installation

Before being able to work on the JavaScript module directly, we will need:

Prerequisite version checks

First, check you have the required tools and versions:

node --version
yarn --version
docker --version    

The versions should match the above prerequisites. If they don’t, you need to install them or upgrade/downgrade them. If you are using NVM (Node Version Manager) you can simply do:

nvm install 18
nvm use 18    

For Yarn, if you already have a recent install, you can set the version like this:

yarn set version stable    

For Docker, it is recommended you upgrade it to the latest version. If you are using a command line version, use whatever package manager it was installed with to upgrade it, and if using Docker Desktop use the Settings screen to update it to the latest version.

Jahia Docker Image Install & Start

The easiest way to install a Jahia server with GraalVM support is to use the Docker image provided by Jahia. You can pull and start a container using the following command in a Linux/macOS Terminal or Windows Powershell:

docker run  -p 8080:8080 -p 8000:8000 -p 8101:8101 -p 10001:10001 -p 8443:8443 -p 9229:9229 -e "JPDA=true" -e "JAHIA_DISABLE_SNAPSHOTS_PULL=true" --name jahia-ee jahia/jahia-ee:8.2.0.4    

Please note that this will download (pull) about 1.3 GB of data. Visit this link to learn more about the command options : running the jahia docker image.

Once you see the following entries in the log, this means the server has completed its startup:

2023-06-05 09:32:11,990: INFO  [EndInit] - --------------------------------------------------------------------------------------------------
2023-06-05 09:32:11,990: INFO  [EndInit] -   D E V E L O P M E N T   M O D E   A C T I V E
2023-06-05 09:32:11,991: INFO  [EndInit] -   In development mode, Jahia will allow JSPs to be modified, modules to be
2023-06-05 09:32:11,991: INFO  [EndInit] -   re-deployed and other modifications to happen immediately, but these DO have a performance impact.
2023-06-05 09:32:11,991: INFO  [EndInit] -   It is strongly recommended to switch to production mode when running performance tests or going live.
2023-06-05 09:32:11,991: INFO  [EndInit] -   The setting to change modes is called operatingMode in the jahia.properties configuration file.
2023-06-05 09:32:11,991: INFO  [EndInit] - --------------------------------------------------------------------------------------------------
2023-06-05 09:32:11,991: INFO  [EndInit] -   Modules:
2023-06-05 09:32:11,991: INFO  [EndInit] -       Started: 58
2023-06-05 09:32:11,994: INFO  [EndInit] - --------------------------------------------------------------------------------------------------
2023-06-05 09:32:12,018: INFO  [EndInit] -   Jahia 8.2.x.x [Kimchi] - Build: 3957d6e - Built on: June 3, 2023 at 2:33:20 PM UTC is now ready. Initialization completed in 72 seconds
2023-06-05 09:32:12,018: INFO  [EndInit] - --------------------------------------------------------------------------------------------------

    

You should then be able to connect to your Jahia instance by opening a browser at the URL: http://localhost:8080

And login with:

  • username: root
  • password: root1234

 

Install & start the latest version of npm-modules-engine

Since the release of Jahia 8.2, some updates were made the "npm-modules-engine", the piece of code in charge of deploying JavaScript modules. Follow the next steps to update this module: 

  1. Once logged in, go to  Administration>Server>Modules and Extensions>Modules.
    update-npm-modules-engine.png
  2. On the Modules page, enter npm as search criteria in the search box.
  3. Click the download icon install-module-green-arrow.png to install the version 0.5.0 of the npm-modules-engine module 
  4. Then click the start icon module-start.png to start the version 0.5.0. The npm-modules-engine should look like this: 

040-started.png

  1. At last, undeploy the version 0.2.0 using the undeploy icon module-undeploy.png.

Next step

Continue to integrating a static HTML template