Install wasm-opt version 101
A step-by-step guide to fixing the wasm-opt version 91 error.

ERROR: Your wasm-opt version is 91, but we require a version >= 99.

Those following the Substrate Ink! Tutorial may be confronted with an error on this page (https://substrate.dev/substrate-contracts-workshop/#/0/building-your-contract) when running the build command:
1
cargo +nightly contract build
Copied!
Porta is here to help. This guide explains the fix that will have you up and running in a matter of minutes.

Guide

You can see your version of wasm-opt by running the following command:
1
wasm-opt -- version
Copied!
We fix this by downloading version 101 and overwriting the old files with the new.
Navigate to the following website:
Download:
1
binaryen-version_101-x86_64-linux.tar.gz
Copied!
The file will now be in your Downloads folder, so please extract it.
You should now have the extracted folder in your Downloads folder.
Open a terminal and navigate to the following directory:
When using the following command, you will need to replace the word ‘linux’ with term right for you.
The following commands copy the contents of the bin, lib64 and include directories from binaryen download to your computer.
Command 1:
1
sudo cp -r home/linux/Downloads/binaryen-version_101-x86_64-linux/binaryen-version_101/bin/* /bin
Copied!
Command 2:
1
sudo cp -r home/linux/Downloads/binaryen-version_101-x86_64-linux/binaryen-version_101/include/* /usr/include
Copied!
Command 3:
1
sudo cp -r home/linux/Downloads/binaryen-version_101-x86_64-linux/binaryen-version_101/lib64/* /lib64
Copied!
Running the wasm-opt -- version command now shows version 101
Now when you run the build command, everything goes well
cargo +nightly contract build
Last modified 2mo ago
Copy link