Installation mechanism besides npm?

Resolved 💬 26 comments Opened Feb 25, 2025 by alex Closed Jul 11, 2025
💡 Likely answer: A maintainer (wolffiex, collaborator) responded on this thread — see the highlighted reply below.

For those of us who aren't JS users, and thus don't already have npm on our systems, it'd be great to have an alternative installation mechanism.

For me personally, providing a brew tap (or even better, an upstream brew formula) would be wunderbar!

Thanks

View original on GitHub ↗

26 Comments

djsavvy · 1 year ago

Great idea! this would be really nice since I don't think npm tools are the best-equipped to self-update, as evidenced by the admonition I'm getting every startup :D

marafa-sugarcrm · 1 year ago

as per my comment in #454 i used this for the homebrew formula

require "language/node"

class ClaudeCode < Formula
  desc "Command line interface for Claude AI by Anthropic"
  homepage "https://www.anthropic.com"
  url "https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-0.2.37.tgz"
  sha256 "ddf92e983a7bad6875d6436deabc32bfbbdfa75b43655c10777ae9d2a9d9a9da"
  license "MIT"

  livecheck do
    url "https://registry.npmjs.org/@anthropic-ai/claude-code/latest"
    regex(/["']version["']:\s*["']([^"']+)["']/i)
  end

  depends_on "node"

  def install
    # Install the package globally within the Homebrew prefix
    system "npm", "install", "-g", "--prefix", prefix, "@anthropic-ai/claude-code@#{version}"
  end

  test do
    system bin/"claude-code", "--help"
  end
end

and run as
brew install --build-from-source ./claude-code.rb

alex · 1 year ago

Have you considered submitting that to homebrew itself? (I haven't checked if it complies with the rules)

Dentrax · 1 year ago

Any updates on this? I found claude on Homebrew: https://formulae.brew.sh/cask/claude but suspect if its claude-code.

brew install --cask claude-code

This would be great to have.

Moulick · 1 year ago
Moulick · 1 year ago

Not possible in homebrew core unfortunately, It need to be under any of the ~opensource licenses.

RichardoC · 1 year ago

You could maintain your own tap so folks would just need to do brew install anthropics/claude-code/claude-code or similar

Moulick · 1 year ago

I'll be happy to write the brew file but someone from Anthropic (@bcherny ?) needs to make the repo, it should be anthropics/homebrew-claude-code or maybe even anthropics/homebrew-claude to cover all in one

wolffiex collaborator · 1 year ago

We are in the middle of updating our distribution to a single file binary. Please hang tight and then we can come back for the brew cask. I'll be the POC for Claude Code on this one.

mieubrisse · 1 year ago

Hey @wolffiex , any chance this is available? Would love to use Claude Code without needing to globally install NPM!

Jarvvski · 1 year ago

@wolffiex any news? Would be great to get this out there 💪🏻

wolffiex collaborator · 1 year ago

Working on it! This just requires extreme care because makes will strand
our users. I'll update this thread first when it is available.

On Wed, Jun 18, 2025 at 9:02 AM Jarvis @.***> wrote:

Jarvvski left a comment (anthropics/claude-code#80) <https://github.com/anthropics/claude-code/issues/80#issuecomment-2984844482> @wolffiex <https://github.com/wolffiex> any news? Would be great to get this out there 💪🏻 — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/80#issuecomment-2984844482>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AABUJ7FBJECQQ5BEY6NDRLD3EGER3AVCNFSM6AAAAABX27EY4CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSOBUHA2DINBYGI> . You are receiving this because you were mentioned.Message ID: @.***>
tdensmore · 1 year ago
We are in the middle of updating our distribution to a single file binary. Please hang tight and then we can come back for the brew cask. I'll be the POC for Claude Code on this one.

Any updates on this?

wolffiex collaborator · 1 year ago

Oh yes, we are starting testing of our new native install! If you are _brave_ and you're willing to solve potential problems with alpha software, try this:

curl -fsSL claude.ai/install.sh | bash

let us know how it goes!

xshapira · 1 year ago
Oh yes, we are starting testing of our new native install! If you are _brave_ and you're willing to solve potential problems with alpha software, try this: `` curl -fsSL claude.ai/install.sh | bash `` let us know how it goes!

@wolffiex Thanks!

Installed, but I can't update Claude to the latest version:

!Image

wolffiex collaborator · 1 year ago

you will have to figure out why you're picking up the wrong claude
could be an alias hanging around, or failed uninstall of the global npm version
the native install is a symlink at ~/.local/bin/claude
please let us know how you resolve and we'll continue to work on our auto-detection

Jarvvski · 1 year ago

Does the closure mean the brew file is done? Or do you just refer to the binary installation from your website

wolffiex collaborator · 1 year ago

brew tap is not done but we will work on it
for now, use curl -fsSL claude.ai/install.sh | bash

azat-io · 1 year ago

Are there any plans to support brew?

Jarvvski · 1 year ago

I've opened a PR for adding a cask that just refers to the installer you're providing @wolffiex

https://github.com/Homebrew/homebrew-cask/pull/219840

IMO, would be better to move the checksum verification and arch detection inside of the ruby formulae, but I didn't want to mess with your current deployments where you're checking all of that _inside_ the install.sh

Checking the installer, we could handle all of the installation in the ruby script. But again, not sure what your other plans are

Am i missing other files for the uninstallation other than the binary over in .local/bin/claude and .claude/? The script doesn't provide any uninstall method, so I had to make some assumptions

timfallmk · 1 year ago

@Jarvvski You may want to deconstruct the install.sh and move the logic inside the .rb. Depending on what's available upstream you may be able to do some version/arch parsing logic there.

wolffiex collaborator · 1 year ago

Wow, this is awesome @Jarvvski thank you. I was worried we were going to have to push my ruby slop to create a homebrew cask. Could this be called claude instead of claude-code? We are slowly consolidating around that naming for the package.

The auto-updater is very important to us and we want that to be the default—that is the main benefit of claude install over handling everything directly in homebrew. We can definitely provide claude uninstall but we also want to be good homebrew citizens and observe the local customs, so happy to take some input if you want to give it.

nihaals · 12 months ago
xshapira · 12 months ago
A Homebrew cask has now been added (Homebrew/homebrew-cask#219994, brew.sh).

@nihaals Works like a charm! Thank you 💪

mieubrisse · 12 months ago

Working for me too! Thanks everyone; you guys are awesome 🥳

github-actions[bot] · 11 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.