Skip to content

Installation

James Messinger edited this page Dec 20, 2019 · 2 revisions

CodeEngine

CodeEngine is published as an NPM package, which can be installed using the NPM CLI.

Table of Contents

Prerequisites

To install CodeEngine, you need the following software to be installed first:

Node.js version 13.0.0 or later

To see if you have Node.js installed, or to check which version you have installed, open a terminal window and run the following command:

node --version

If you get an error, then Node isn't installed. If you see a version number that's lower than 13.0.0, then you need a newer version. Either way, you can go here to download Node.js and install it.

NPM

You'll need NPM to install CodeEngine, generators, and plugins. NPM is installed automatically by Node.js, so you may already have it. Open a terminal window and run the following command to check:

npm --version

Installation

Install CodeEngine using the npm install command. Add the -g flag to install globally so you can run CodeEngine from any terminal window.

npm install -g code-engine

To verify that CodeEngine installed successfully, run the following command:

code-engine --help

Permissions

Depending on the security settings of your computer, you may get permissions errors when installing CodeEngine, generators, or plugins via NPM. If you see an EACCES error, or any other error related to permissions, then there are a couple workarounds.

Option 1: Change NPM's default directory

By default, NPM installs global packages in a system directory that you might not have write access to, which could cause permissions errors. You can change NPM's default directory to one that you do have write access to.

mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'NPM_CONFIG_PREFIX=~/.npm-global` > ~/.profile

Option 2: Use unsafe permissions

When running the npm install command, you can add --unsafe-perm to the end of the command. This installs the package using your user account, rather than the default low-privileged account.

npm install -g code-engine --unsafe-perm

You can also configure NPM to use unsafe-perm by default, so you don't have to specify it each time.

npm config set unsafe-perm true
Clone this wiki locally