CLI Troubleshooting

Written By Luke Wakefield

Last updated 12 days ago

Is your website project folder inside a Cloud Virtual Drive?

There are known issues with using the Siteglide CLI on a directory inside a Google Drive or Microsoft One Drive or equivalent. While this may be solved with complex settings changes, we are not able to guide you through this and recommend instead that you store your project directories in a standard hard drive e.g. C.

For backups we recommend https://www.sitegurus.io/protect or for more advanced version control https://github.com/.

Not Sure if You've Set Up Siteglide CLI Already?

In a Command Line, in any directory, type in:

Example
siteglide-cli -v

If you already have siteglide-cli installed globally, this will tell you which version you have installed.

You can find out which is the latest version here: https://www.npmjs.com/package/@siteglide/siteglide-cli

Have You Installed the Dependencies?

The CLI is distributed via Node Package Manager (NPM) and so you will need NodeJS installed on your machine. The easiest way to get this is to visit https://nodejs.org/ and download the LTS version as this has better support.

Siteglide CLI requires a minimum of NodeJS version 10 but we recommend using the latest / LTS version

Open the download and follow the wizard with the default options to finish install.

Have you Installed the CLI Globally on your Machine?

You can use the following to install Siteglide CLI in any directory. The -g flag instructs your machine to make this command available in any directory (globally)- so you only need to do this on your machine once.

npm i -g @siteglide/siteglide-cli

When an update is released for the CLI, you can use the same command as above to install the updated version. Please note that the flags for commands below are not available on all versions of the CLI, updating to the latest version will allow you to use all of them.

Issues Installing on Windows?

The following video will give you a complete walkthrough guide for setting up Siteglide CLI on a Windows machine. Feel free to skip ahead to the parts you find the most useful.

Issues Installing on a Mac?

The following video will give you a complete walkthrough guide for setting up Siteglide CLI on a Mac. Feel free to skip ahead to the parts you find the most useful.

The steps followed in the video can be found here. If you are using zsh as your shell then the commands here will have to be run against the ~/.zshrc file, not ~/.profile. ZSH is the default for Macs since macOS Catalina, to find out which shell you are using you can run echo ${SHELL} in terminal. If the ~/.profile or ~/.zshrc files do not already exist then you may need to create them first before running the export PATH command

Struggling to Connect to a Site?

Read our in-depth guide:

Site Setup

Making sure your machine knows where npm installs global packages

Possible symptoms:

  • Running npm list -g shows siteglide-cli in the list so we know it’s installed

  • But running any siteglide-cli command gives a response similar to command not found

Both Windows and Apple computers have a PATH file. This can get technical, but a simple way to think about it is a list of system shortcuts for programs which can be run from the command line. Normally, applications add important things to PATH for you, but sometimes they don’t and sometimes it’s a choice during install and you might not have selected that option.

If you already have an AI assistant e.g. Claude on your machine, you can ask it to 1) check which folder npm is using to install global packages and 2) make sure that dir is added to my system PATH file.

Or you can do this manually:

Find out where npm is installing global packages:

Run npm root -g and make a note of the answer.

Add to PATH on Windows

  1. Press Win + R, type sysdm.cpl, press Enter

  2. Go to Advanced → Environment Variables

  3. Under User variables (just for you) or System variables (all users), select Path → Edit

  4. Click New and paste your directory path (e.g. C:\Program Files\nodejs)

  5. Click OK on all dialogs

  6. Restart any open terminals (or log out/in) for changes to apply

OR via PowerShell:

[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\path\to\your\directory", "User")

Add to PATH on Mac

For zsh (default on macOS Catalina+), add to ~/.zshrc:

export PATH="/path/to/your/directory:$PATH"

For bash, add to ~/.bash_profile or ~/.bashrc:

export PATH="/path/to/your/directory:$PATH"

Then reload:

source ~/.zshrc # or source ~/.bash_profile

Verify it worked (both platforms):

echo $PATH # Mac/Linux 

echo $env:Path # Windows PowerShell

Permissions

  • Did you get some kind of error when trying to run npm i siteglide-cli -g which looks like: Error: EPERM: operation not permitted or Error: EACCES: permission denied ?

  • Does npm config get prefix point at a folder your system user does not own?

Switch user or change system permissions

In some situations, you may find you’re logged into your machine as the wrong user, and you can log out and login as the correct user. Most of the time, this is unlikely.

In some situations the person who is already system administrator might grant you permission as a system administrator yourself.

Temporarily Elevate Permission

Elevated permissions e.g. on Apple sudo or Windows Run terminal as administrator help when npm cannot write to a protected folder (often global installs). Use them as a short term solution where you know the adminstrator password, but your current user is not the owner of the folder.

But be aware, simply elevating the permissions as a one-off will probably lead to the same issue again in future when you are prompted to update a package.

Windows

Run the terminal as Administrator

  1. Open Start, search for PowerShell, Command Prompt, or Windows Terminal.

  2. Right-click it → Run as administrator.

  3. Accept the UAC prompt.

  4. Retry the install:

npm install siteglide-cli -g

Mac

Use sudo for that one command

sudo npm install -g <package-name>

Enter the Mac login password (nothing appears as you type). That command runs as root; later commands in the same window do not.

Long term fix - use a node version manager

Node and global packages live under the user’s home folder, so npm i -g never needs elevation.

Mac

# Install nvm (or fnm / volta — same idea) curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

Close and reopen Terminal, then:

nvm install --lts nvm use --lts node -v npm -v

If they previously used sudo npm i -g, fix cache ownership first:

sudo chown -R $(whoami) ~/.npm ~/.config

Then install the CLI without sudo:

npm i -g @siteglide/siteglide-cli

Confirm:

which node # should be under ~/.nvm/... npm config get prefix # should be under ~/.nvm/... which siteglide-cli

Windows

Microsoft’s guidance is nvm-windows (not Mac nvm).

  1. Uninstall the official Node.js installer (Add or Remove Programs).

  2. Delete leftover folders if they still exist:

    • C:\Program Files\nodejs

    • %AppData%\npm

  3. Install nvm-windows.

  4. Open a new terminal:

nvm install lts nvm use lts npm i -g @siteglide/siteglide-cli

Confirm:

where.exe node npm config get prefix

node should not be under C:\Program Files\nodejs.

Debug Mode

Sometimes Siteglide support may ask you to run the CLI in "debug mode". This provides more output into your terminal so that we can use it to aid in supporting you. To do this, you need to prefix the command you are running with some extra information. This prefix differs slightly on macOS, Linux and Windows, for example if you were to want to sync to a site with debug mode on:

Linux

Example
DEBUG=true siteglide-cli sync production

macOS

Example
DEBUG=true siteglide-cli sync production

Windows Command Prompt

Example
set DEBUG=true && siteglide-cli sync production

Windows Powershell

Note, for macOS and Linux, debugging will be turned on for that one command that you prefix. For Windows, debugging will be turned on for as long as Command Prompt or Powershell is open. Closing Command Prompt or Powershell and re-opening it will turn debug mode off.