Skip to content

Installation of the Edge-Impulse-Cli on Ubuntu/Raspbian/Linux without requirement of administrator permissions or running into npm errors

Notifications You must be signed in to change notification settings

dhruvmsheth/edge-impulse-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

Edge Impulse CLI Installation guide

To install the cli on ubuntu 20.10 or raspbian os - follow this guide to avoid breaking your sudo command:

Option 1- Installation on Ubuntu 20.10:

$ curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
$ sudo apt-get install -y nodejs

Check if the version is v14 or above

$ node -v
$ curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh

The above script installs arduino cli

$ npm config get prefix

Type the above command and check if it returns usr back on your terminal. if it does, you are good to go ahead! If it returns usr/local, head onto option 2. Make sure you have Python3.7 and above to execute all the functions.

$ sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
$ npm install -g edge-impulse-cli

This installs the Edge-impulse-cli and so, you can go ahead and execute the commands to configure mcu with the Edge impulse dashboard.

Bingo! Now you have installed the cli on Ubuntu 20.10

Option 2: Installation on Raspbian OS:

The installation on the Raspbian OS is a bit longer than ubuntu, because you need to change the installation path so that you do not require root/administrator permissions while execution of the CLI. Go ahead and follow the instructions for installation.

Instructions for manually changing default directory

To minimize the chance of permissions errors, you can configure npm to use a different directory. In this example, you will create and use hidden directory in your home directory.

  • Back up your computer.
  • On the command line, in your home directory, create a directory for global installations:
$ curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
$ sudo apt-get install -y nodejs

Check if the version is v14 or above

$ node -v
$ curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh

If it returns that the directory is not on path, type

npm config get prefix

Whatever output you get-add in place of home/dave/work

export PATH=/home/dave/work:$PATH

The above script installs arduino cli

$ npm config get prefix

This command should return usr/local. Now follow the below steps, to set it on path so you do not require administrative permisiions

$ mkdir ~/.npm-global

Configure npm to use the new directory path:

$ npm config set prefix '~/.npm-global'

In your preferred text editor, open or create a ~/.profile file and add this line:

export PATH=~/.npm-global/bin:$PATH

On the command line, update your system variables:

$ source ~/.profile

Now install the cli:

$ npm install -g edge-impulse-cli

This installs the Edge-impulse-cli and so, you can go ahead and execute the commands to configure mcu with the Edge impulse dashboard.

Bingo! Now you have installed the cli on Raspbian OS

If there are any error you come across, create an issue and I will help solve it :)

Source: -https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally -KraigM/homebridge-harmonyhub#97

About

Installation of the Edge-Impulse-Cli on Ubuntu/Raspbian/Linux without requirement of administrator permissions or running into npm errors

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages