在Ubuntu Bionic上安装Hyperledger Composer前置依赖时出错
Hey there, let's figure out why you're getting that error and how to work around it.
First things first: Hyperledger Composer is no longer actively maintained, and its official installation scripts only support Ubuntu Xenial (16.04 LTS). That's exactly why your Ubuntu Bionic (18.04) setup is throwing the "not supported" message. But you've got a couple solid options to move forward:
Option 1: Switch to a Supported Ubuntu Version
The most reliable fix is to use an Ubuntu Xenial (16.04 LTS) environment. You can set this up easily with a virtual machine (like VirtualBox) or a Docker container — this way you don't have to mess with your current Bionic system. Once you're running Xenial, the official prerequisites script will run without any issues.
Option 2: Manually Install Prerequisites on Bionic
If you want to stick with Ubuntu Bionic, skip the official installation script and install each dependency manually. Here's a step-by-step breakdown:
- Node.js 8.x (LTS): Composer requires this specific Node version. Use Node Version Manager (nvm) to install it cleanly:
- Install nvm by running its official setup script:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash - Reload your shell (or run
source ~/.bashrc), then install and use Node 8.17.0:nvm install 8.17.0 nvm use 8.17.0
- Install nvm by running its official setup script:
- Docker: Install Docker Community Edition for Ubuntu Bionic. You can use
aptwith Docker's official repository or their convenience script (follow Docker's standard Ubuntu installation steps for Bionic). - Docker Compose 1.23.x: This version is compatible with Composer. Download and set it up with:
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose - Git: Install via your system package manager:
sudo apt-get install git -y - Python 2.7: Bionic defaults to Python 3, so install Python 2.7 with:
If you need Python 2.7 to be the default for certain commands, usesudo apt-get install python2.7 -yupdate-alternativesto configure that.
Once all dependencies are installed, you can install the Hyperledger Composer CLI tools using npm:
npm install -g composer-cli@0.20.8
Just keep in mind that since Bionic isn't officially supported, you might run into minor compatibility glitches along the way. If you hit snags, switching to Xenial is the safest path.
内容的提问来源于stack exchange,提问作者user9575931

