Run the following command in a shell:

npm install @magnolia/cli -g

Depending on your permissions and the location where you have installed Node.js, you may have to execute the command above with root permissions. 
Without installation permissions you will notice messages such as npm ERR! in the shell. 
On Linux or OS-X to run this command as root use:

sudo npm install @magnolia/cli -g

If the installation is successful, you see the following or a similar output in the shell:

/usr/bin/mgnl -> /usr/lib/node_modules/@magnolia/cli/bin/mgnl.js

> spawn-sync@1.0.15 postinstall /usr/lib/node_modules/@magnolia/cli/node_modules/spawn-sync
> node postinstall

+ @magnolia/cli@2.2.0
added 209 packages in 11.40

If you already installed Magnolia CLI, update to the latest version:

npm update @magnolia/cli -g

Once you have installed Magnolia CLI, test the installation by running the following command in the shell:

mgnl help 

  Usage: mgnl <command> [options]

  A tool to setup and facilitate light development with Magnolia CMS

  Options:

    -V, --version  output the version number
    -h, --help     output usage information

  Commands:

    jumpstart               download and setup a Magnolia CMS instance for development.
    start                   start up a Magnolia CMS instance. To stop it, enter CTRL+C
    add-availability        add component availability.
    build                   scan a node_modules folder for npm packages with the keyword "magnolia-light-module" (in package.json) and extract them to a directory of choice.
    create-component        create a component and optionally add availability for it.
    create-light-module     create a light module.
    create-page             create a page template.
    customize-local-config  extract "mgnl-cli-prototypes" folder and "mgnl-cli.json" file to customize CLI configuration.
    install                 install a light module from npm to the local Magnolia instance.
    search                  search for a light module on npm.
    tab-completion          install tab autocomplete feature for Bash, zsh or PowerShell
    help [cmd]              display help for [cmd]

  mgnl: 2.2.0 node: v6.11.0 os: darwin
#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels