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

wrangler: command not found #1632

Closed
famzah opened this issue Nov 1, 2020 · 7 comments
Closed

wrangler: command not found #1632

famzah opened this issue Nov 1, 2020 · 7 comments
Labels
bug Something isn't working onboarding Issues with installation or login timed out

Comments

@famzah
Copy link

famzah commented Nov 1, 2020

I've installed Wrangler following the instructions in the Dashboard:
npm install -g @cloudflare/wrangler

The installation seems to have completed successfully:

$ npm install -g @cloudflare/wrangler
/home/famzah/.node-v9.4.0-linux-x64/bin/wrangler -> /home/famzah/.node-v9.4.0-linux-x64/lib/node_modules/@cloudflare/wrangler/run-wrangler.js

> @cloudflare/wrangler@1.12.1 postinstall /home/famzah/.node-v9.4.0-linux-x64/lib/node_modules/@cloudflare/wrangler
> node ./install-wrangler.js

Downloading release https://workers.cloudflare.com/get-npm-wrangler-binary/1.12.1/x86_64-unknown-linux-musl
wrangler has been installed!
+ @cloudflare/wrangler@1.12.1
added 34 packages in 5.088s

However, the binary is not added in my $PATH and I get the following when executing wrangler:
wrangler: command not found

I see the following executable files with the name "wrangler" in my home directory:

/home/famzah/.wrangler/bin/wrangler # ELF 64-bit LSB executable, statically linked
/home/famzah/.node-v9.4.0-linux-x64/bin/wrangler -> /home/famzah/.node-v9.4.0-linux-x64/lib/node_modules/@cloudflare/wrangler/run-wrangler.js # a tiny JavaScript

Both binaries seem to do the same -- they invoke the Wrangler CLI and show the following version info:
👷 ✨ wrangler 1.12.0

I've got the following questions:

  • Which of the two executables should I use for the Wrangler CLI?
  • None of them was added in any of the (local) $PATH directories. What's the expected behavior, so that the command wrangler works?
@famzah
Copy link
Author

famzah commented Nov 1, 2020

This seems related to #266.

@nataliescottdavidson
Copy link
Contributor

@famzah the wrangler executable should be at /usr/local/bin/wrangler. Have you installed npm with a version manager such as nvm? Your npm install can effect where packages get installed

@famzah
Copy link
Author

famzah commented Nov 6, 2020

Thank you @nataliescottdavidson.

It's probably my custom installation of npm that's causing the issue. I've downloaded the "Linux Binaries (x64)" from the official Node.js website. Then symlink'ed the binary in my $PATH:

$ ls -la ~/bin/npm
/home/famzah/bin/npm -> /home/famzah/.node-v9.4.0-linux-x64/bin/npm

It's logical that I also needed to add ~/.node-v9.4.0-linux-x64/bin to my $PATH.


Alright, then only the other question is still open. I see the following executable files with the name "wrangler" in my home directory:

/home/famzah/.wrangler/bin/wrangler # ELF 64-bit LSB executable, statically linked
/home/famzah/.node-v9.4.0-linux-x64/bin/wrangler -> /home/famzah/.node-v9.4.0-linux-x64/lib/node_modules/@cloudflare/wrangler/run-wrangler.js # a tiny JavaScript

Both binaries seem to do the same -- they invoke the Wrangler CLI and show the following version info:
👷 ✨ wrangler 1.12.0

❓ Which of the two executables should I use for the Wrangler CLI? Why there are two executables doing the same thing?

@famzah
Copy link
Author

famzah commented Nov 23, 2020

Hi. Did you have a chance to look into this?

@Electroid Electroid added bug Something isn't working onboarding Issues with installation or login and removed user report labels Feb 22, 2021
@dulcineapena1
Copy link

I had the same issue, by following this instructions it fix it.
Basically you need to install wrangler without sudo
https://github.com/sindresorhus/guides/blob/main/npm-global-without-sudo.md

@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it has not had recent activity in the last 180 days. It will be closed if no further activity occurs in the next week. Please feel free to comment if you'd like it to remain open, and thank you for your contributions.

@stale stale bot added the timed out label Jan 9, 2022
@stale
Copy link

stale bot commented Mar 2, 2022

This issue has been automatically closed because it has not had recent activity. You may re-open the issue if it is still relevant.

@stale stale bot closed this as completed Mar 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working onboarding Issues with installation or login timed out
Projects
None yet
Development

No branches or pull requests

4 participants