Install Claude Code on RISC-V Linux Hosts

Claude Code is damn powerful! But if you want to install it on RISC-V Linux hosts via the official installer script, you will be greeted with some cold rejection!

jsun@lpi4a:~$ curl -fsSL https://claude.ai/install.sh | bash
Unsupported architecture: riscv64

Below is the workaround method, tested on LicheePi 4A board:

# install nodejs (>=v18) and npm
sudo apt install nodejs npm

# (optional) install npm packages to user-local; no sudo needed
mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

# install claude-code as npm package
npm install -g @anthropic-ai/claude-code

# run!
cd ~/my-code
claude