Installing AEK 2 in 2021
AEK 2 was first released in 2016, designed for Node v8 (and React v13). Over the years we’ve updated it (to target Node v10, and React v15, and later React v16). With these changes came changes to the underlying technologies (swapping out npm for Yarn, for example). These third-party packages aren’t something we can maintain ourselves, and over the years we’ve noticed specific issues on a range of machines when installing AEK 2 for the first time.
This blog post aims to provide an up-to-date overview of how to manage your versions of Node.js and install and use AEK 2 with them.
Node versions and the AEK
The AEK is still intended to be used with Node 10 (any release, though generally the latest is the best). Past releases of Node.js can be found here on their site. For reference, the latest versions of 10 and 12 (currently) are listed below.
- Node 10.24.1. Direct link to packages and installers.
- Node 12.22.5. Direct link to packages and installers.
We list Node 12 here because there is a known issue with aek install on Node 10 (any version of Node 10). We currently don’t have a fix implemented for this issue, but to get around it you can run aek install on the package in question under Node 12. All other commands work with Node 10, and may have issues on Node 12.
Normally you can’t have more than one version of Node.js installed at a time. There is a utility on Windows we recommend for this called nvm-for-windows, or Node Version Manager for Windows (for Mac and other operating systems, there is nvm). Please follow the instructions in the README.md to set it up. It requires you to completely uninstall your existing Node.js version (if you have any installed).
Once you have nvm-for-windows installed, you can keep on adding different Node versions and switching between them as required. Each Node version is completely independent of any others, and any packages installed to one will not be shared with others. You will need to install the AEK CLI separate for each version of Node.js you install.
Installing the AEK
Before you try to install the AEK CLI, please do the following:
- Use NPM config to link the @ombiel name-spaced packages:
npm config set @ombiel:registry https://npm.campusm.net/.
- Install Yarn:
npm install -g yarn.
- Check you have
gulp-cliinstalled. You can test this in a terminal program with
gulpisn’t recognised as a program, or your CLI version is “Unknown”, install it with
yarn global add gulp-cli.
- You can then use Yarn to install the CLI:
yarn global add https://npm.campusm.net/get/aek-cli.
This should be enough in most cases to get the AEK up and running.
Reminder – you will need to repeat this process for each version of Node that you have installed. So if you have both Node 10.24.1 and Node 12.22.5 installed, you will need to link the config, install Yarn, and then the AEK CLI twice.
Windows users, you might still have a problem in running the aek command from the command line. It will tell you that “aek is not recognised as an internal or external command”. This is due to an issue with installing yarn modules globally. If you encounter this, follow the steps below:
- Check if your yarn prefix is set with
yarn config get prefix, in a terminal program of your choice.
- If it isn’t set, set it to the parent directory of the following command:
yarn global bin.
- It’ll look something like
- It’ll look something like
yarn config set prefix FILEPATHto do this (where
FILEPATHis the directory we found on the line above).
- Add the actual bin to your system PATH with
- You can also do this via “Edit the system environment variables”, which can be found under System in Control Panel, or by searching for “environment variables” in the Start Menu.
- Restart your terminal program (be it cmd, PowerShell, or something different) and try
- If it still doesn’t work, add the parent directory from step 2 to your system PATH as well (again, this can be done using the Control Panel instead of a terminal).
- NPM and Yarn with AEK 2.
- Managing dependencies in AEK 2.
- AEK 2 Documentation (the campusM NPM repository). This requires the same login as the AEK CLI; your App Manager username and password.
- What’s New in React 16 (and changes from AEK 2 projects using React 15). This is also on the campusM NPM repository and requires the same login.