Skip to content

Commit

Permalink
use nvm for node on ubuntu, other tweaks
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Gregory <[email protected]>
  • Loading branch information
ericgregory committed Dec 13, 2024
1 parent 7736ee4 commit af5bc44
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions docs/tour/hello-world.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Requirements:
<Tabs groupId="os" queryString>
<TabItem value="macos" label="macOS">

On macOS, you can use [Homebrew](https://brew.sh/) to install the Go toolchain:
On macOS, you can use [Homebrew](https://brew.sh/) to install the Go toolchain. (See the [official Go documentation](https://go.dev/doc/install) for other options.)

```shell
brew install go
Expand All @@ -124,21 +124,17 @@ brew install wasm-tools

<TabItem value="ubuntu" label="Ubuntu/Debian">

On Ubuntu/Debian, Go 1.23+ isn't currently available via major package managers, but you can use `curl` or `wget` to download the Go toolchain from the [official Go download page](https://go.dev/dl/).
On Ubuntu/Debian, Go 1.23+ isn't currently available via major package managers, but you can use `curl` or `wget` to download the Go toolchain from the [official Go download page](https://go.dev/dl/). (See the [official Go documentation](https://go.dev/doc/install) for other options.)

Before downloading, ensure that you do not have a previous version of Go installed:

```shell
sudo rm -rf /usr/local/go
```
Before downloading, ensure that you do not have a previous version of Go installed. You can find an existing installation in the `/usr/local/go` directory.

Consult the [download page](https://go.dev/dl/) and set environment variables specifying the appropriate version and architecture for your system. (The values below are examples.)

```shell
GO_VERSION="1.23.4"
export GO_VERSION="1.23.4"
```
```shell
GO_ARCH="arm64"
export GO_ARCH="amd64"
```

Download your file:
Expand All @@ -147,10 +143,10 @@ Download your file:
curl -O -L "https://golang.org/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz"
```

Find the appropriate checksum value for your file on the [download page](https://go.dev/dl/) and validate the file:
Find the appropriate checksum value for your file on the [download page](https://go.dev/dl/) and validate the file. (The example below uses the checksum value for the v1.23.4 on `amd64` download.)

```shell
echo -n "CHECKSUMVALUEHERE *go${GO_VERSION}.linux-${GO_ARCH}.tar.gz" | shasum -a 256 --check
echo -n "6924efde5de86fe277676e929dc9917d466efa02fb934197bc2eba35d5680971 *go${GO_VERSION}.linux-${GO_ARCH}.tar.gz" | shasum -a 256 --check
```

Extract the file:
Expand All @@ -174,10 +170,10 @@ mv -v go /usr/local
On Ubuntu/Debian, you can download TinyGo similarly. Refer to the [TinyGo GitHub releases page](https://github.com/tinygo-org/tinygo/releases/) to find the correct version and architecture and set environment variables accordingly. (The values below are examples.)

```shell
TINYGO_VERSION="0.34.0"
export TINYGO_VERSION="0.34.0"
```
```shell
TINYGO_ARCH="arm64"
export TINYGO_ARCH="amd64"
```

Now download the `.deb` file:
Expand Down Expand Up @@ -252,7 +248,7 @@ Requirements:
<Tabs groupId="os" queryString>
<TabItem value="macos" label="macOS">

On macOS, you can use [Homebrew](https://brew.sh/) to install `npm` (and Node.js):
On macOS, you can use [Homebrew](https://brew.sh/) to install `npm` and Node.js. (See the [official Node.js documentation](https://nodejs.org/en/learn/getting-started/how-to-install-nodejs) for other options.)

```shell
brew install node
Expand All @@ -261,10 +257,17 @@ brew install node
</TabItem>
<TabItem value="ubuntu" label="Ubuntu/Debian">

On Ubuntu, you can use `snap` to install `npm` (and Node.js):
On Ubuntu, you can install `npm` (and Node.js) using the [Node Version Manager (`nvm`)](https://github.com/nvm-sh/nvm). (See the [official Node.js documentation](https://nodejs.org/en/learn/getting-started/how-to-install-nodejs) for other options.) You can download and install `nvm` using the official installation script:

```shell
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
```
Once the script completes, you may need to start a new shell session.

You can use `nvm` to install the latest Long-Term Service version of `node`:

```shell
sudo snap install node --classic --channel=14
nvm install --lts
```

</TabItem>
Expand Down

0 comments on commit af5bc44

Please sign in to comment.