To install the cli on ubuntu 20.10 or raspbian os - follow this guide to avoid breaking your sudo command:
$ 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
$ 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.
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.
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
$ 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.
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