Skip to content

Latest commit

 

History

History
64 lines (41 loc) · 2.61 KB

00-setup.md

File metadata and controls

64 lines (41 loc) · 2.61 KB

Setup

Configuring your local environment for Spin

First, you have to configure Spin by following the instructions for your operating system from the Spin documentation.

For example, to install Spin from Linux, macOS, or WSL2, run the following commands:

$ curl -fsSL https://developer.fermyon.com/downloads/install.sh | bash
$ sudo mv spin /usr/local/bin/

Alternatively, you can manually install from a GitHub release, or you can build Spin from source.

At this point, you should be able to run Spin commands:

$ spin --version
spin 1.1.0

Now you can configure the templates and plugins we will use as part of this workshop:

# Install the official Spin templates.
$ spin templates install --git https://github.com/fermyon/spin --update
$ spin templates install --git https://github.com/fermyon/spin-js-sdk --update

# Install a few templates we will use to build applications.
$ spin templates install --git https://github.com/radu-matei/spin-kv-explorer --update

# Install the JavaScript plugin for Spin.
$ spin plugin install js2wasm -y

Depending on the programming languages you want to use, you will need to configure their toolchains. For example:

Troubleshooting

Q: I cannot build my Rust application with spin build.

A: Make sure you have configured your Rust toolchain, and have added the wasm32-wasi target using rustup target add wasm32-wasi.

Q: I cannot build my JavaScript or TypeScript application with spin build.

A: Make sure you have configured Node.js and npm, and that you have executed npm install in the directory with your component's package.json file that contains the dependencies.

Learning Summary

In this section you learned how to:

  • Install the latest Spin CLI version
  • Install the latest Spin templates
  • Install the latest Spin plugins

Navigation