Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(getting-started): Refer to nvm installation instructions #1080

Merged
merged 4 commits into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions main/guides/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,31 @@ Currently Agoric supports macOS and Linux (including [Windows Subsystem for Linu

In this section you'll be installing prerequisite components into your environment. If you're working with your own environment rather than using a fresh Ubuntu install, you may already have some or all of these components already installed.

### Installing NVM and Node
### Installing Node.js

<details>
<summary>Installing NVM and Node on Ubuntu</summary>
<summary>Installing Node.js on Ubuntu</summary>

At this point the Node Version Manager (NVM) utility will be installed. `nvm` makes it easy to select the specific version of [Node](https://nodejs.org/) that will be required for this tutorial (v18.16.0).
This tutorial requires a specific version of [Node.js](https://nodejs.org/).

The [nvm](https://github.com/nvm-sh/nvm) (Node Version Manager) utility makes it easy to select the right version.

First, follow the [nvm installation instructions](https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating), including sourcing `nvm.sh` into the shell.
```sh
wget -O- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
# For example:
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
Comment on lines +52 to +53
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is all this gobbledygook necessary? I'm pretty sure @kbennett2000 tested the source ~/.bashrc approach.

Copy link
Member Author

@gibson042 gibson042 May 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That only works for bash, while Fred was using zsh. But the most important aspect of this change is including the https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating link; this block is now just an example for one-stop-shopping and could be removed entirely:

Installing nvm and Node.js on Ubuntu

At this point the nvm (Node Version Manager) utility will be installed. nvm makes it easy to select the specific version of Node.js that will be required for this tutorial (v18.16.0).

First, follow the nvm installation instructions, including sourcing nvm.sh into the shell for later steps.

Then, install Node.js.

nvm install v18.18.0

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this block ... could be removed entirely

I think the tutorial is designed to be self-contained. Every command you have to issue is on one page. (Installing Keplr might be one exception where some steps are not covered in full.)

Fred was using zsh.

The tutorial is one path through the whole process. I think we try to distinguish requirements (node.js) from the detailed existence proof that they can be met (nvm ...).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense, in which case those instructions do have a place. But I've updated to indicate that nvm is a convenient way to satisfy the Node.js requirement rather than a requirement unto itself.

```

Next, run the command:

Then, install Node.js.
```sh
source ~/.bashrc
nvm install v18.18.0
```

Finally, install Node with the command:

Finally, verify the Node.js version.
```sh
nvm install v18.18.0
node --version
```

</details>
Expand Down
Loading