Unable to update wrangler

This may not be entirely a Workers question, but I couldn’t find a different category to post this wrangler question.

I am trying to update my wrangler, but it doesn’t work. It looks like the update goes through, but the version falls back to what I had earlier.

➜  ~ npm uninstall -g @cloudflare/wrangler && npm install -g @cloudflare/wrangler
up to date in 0.028s
/Users/arunsathiya/.nvm/versions/node/v6.11.1/bin/wrangler -> /Users/arunsathiya/.nvm/versions/node/v6.11.1/lib/node_modules/@cloudflare/wrangler/run-wrangler.js

> @cloudflare/[email protected] postinstall /Users/arunsathiya/.nvm/versions/node/v6.11.1/lib/node_modules/@cloudflare/wrangler
> node install-wrangler.js

Downloading release https://workers.cloudflare.com/get-npm-wrangler-binary/1.5.0/x86_64-apple-darwin
Wrangler has been installed!
+ @cloudflare/[email protected]
added 27 packages from 13 contributors in 9.818s
➜  ~ wrangler --help
👷  ✨   wrangler 1.0.0
ashley g williams <[email protected]>

USAGE:
    wrangler [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    build        🦀  Build your worker
    config       🕵️‍♂️ Setup wrangler with your Cloudflare account
    generate     👯   Generates a new worker project
    help         Prints this message or the help of the given subcommand(s)
    init         👯   Generates a wrangler.toml for an existing project
    preview      🔬  Publish your code temporarily on cloudflareworkers.com
    publish      🆙  Push your worker to the orange cloud
    subdomain    👷   Configure your workers.dev subdomain
    whoami       🕵️‍♂️ Retrieve your user info and test your auth config

My npm skills are rather poor, so, this may actually turn to be a npm-specific issue and not workers/wrangler’s.

Any pointers would be fantastic. Thank you!

You can use cargo, might fix your issue.

1 Like

Hi,

have you restarted shell after installing?

other than thatt as adaptive just suggested, uninstall wrangler from npm and try installing it using cargo(rust packge manager).

1 Like

Contrary to the other answers, I would not suggest going through Cargo.

What does which wrangler say? It’s possible that npm installed it, but an older version is on your PATH for some reason.

2 Likes

Thanks for the replies, everyone! I found that I had a path set to ~/.nvm/* on ~/.npmrc. I removed that declaration, restarted terminal and started using n (instead of nvm). Much better now, and I have the latest version of wrangler! Resolved! :white_check_mark:

3 Likes