Skip to content
This repository was archived by the owner on Aug 3, 2023. It is now read-only.

Improve getting started experience by adding more install options and detailed documentation #1903

Closed
ajcwebdev opened this issue May 3, 2021 · 1 comment
Labels
feature Feature requests and suggestions onboarding Issues with installation or login

Comments

@ajcwebdev
Copy link

ajcwebdev commented May 3, 2021

💡 Feature request

After going through a bit of pain trying to get nvm setup to install wrangler I explored a few alternative installation paths. My issues with nvm were my own user error but I eventually gave up and used rustup instead due to the confusing documentation around nvm. This repo points people to nvm as the first way to install wrangler, and I think this could lead to some developers (especially new developers) getting frustrated and moving on to other platforms because they can't even get started with the base config.

Switching to installing with brew and rustup worked and was pretty easy to do but still required messing around with PATH and env variables. This install setup is also slightly customized for M1 by switching the target to x86_64-apple-darwin. All of that makes it still a bit trickier then it should/could be for developers wanting to try out CF Workers for the first time. It also isn't very well documented that this can be achieved with brew at all.

@alexanderson1993 then tipped me off to Volta.sh which ended up being by far the easiest way to get setup compared to nvm and rustup. You can see an explanation of all three installation methods and how they compare here.

Describe the feature

1. Install with volta

curl https://get.volta.sh | zsh
volta install node
npm install -g @cloudflare/wrangler

2. Install with brew and rustup

brew install cloudflare-wrangler
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
rustup target add x86_64-apple-darwin
cargo install wrangler --target=x86_64-apple-darwin

3. Install with nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | zsh
touch .zshrc

Add the following script to .zshrc.

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

Install the current Node LTS and then wrangler.

nvm install --lts
npm install -g @cloudflare/wrangler

Describe the alternatives

This has been discussed in a few previous issues which can be found by dedicated Googler's, but adding this info to the README or at least the Wrangler Install docs would be really useful. Most people will start at the beginning of the README and follow whatever instructions are given, which is why I try to always make the first path the simplest one.

@ajcwebdev ajcwebdev added the feature Feature requests and suggestions label May 3, 2021
@Electroid Electroid added the onboarding Issues with installation or login label May 5, 2021
@jldec
Copy link

jldec commented May 15, 2021

I like the simplicity of downloading a binary from https://github.com/cloudflare/wrangler/releases/latest, and moving it into a directory on my path. For a specific version (e.g. for durable object support), that method is probably the first choice.

Manual installation is menitioned in the docs. Perhaps adding a similar note in the README would help also.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Feature requests and suggestions onboarding Issues with installation or login
Projects
None yet
Development

No branches or pull requests

3 participants