From 8b22a3d69348031d961ef114b77f3ab547898b92 Mon Sep 17 00:00:00 2001 From: Eric McDonald Date: Thu, 27 Feb 2025 10:44:45 -0800 Subject: [PATCH 1/2] fix: README: Encourage users to install package as a non-administrative user for the sake of system security and stability. --- README.md | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2aeed31c..9698b70a 100644 --- a/README.md +++ b/README.md @@ -17,11 +17,27 @@ Some of its key capabilities include: ## Get started -1. Run the following command in your terminal:
- ```sh - npm install -g @anthropic-ai/claude-code - ``` -2. Navigate to your project directory and run claude +1. Install Claude Code using one of these methods: + + **User-level installation** (recommended, no `sudo` required): + ```sh + mkdir -p ~/.local/share/npm-packages + npm config set prefix ~/.local/share/npm-packages + export PATH=~/.local/share/npm-packages/bin:$PATH + npm install -g @anthropic-ai/claude-code + ``` + + *Add `export PATH=~/.local/share/npm-packages/bin:$PATH` to your `~/.bashrc` or `~/.zshrc` to make the change permanent.* + + **Installation inside of a virtual environment** (from `nvm`, etc...): + ```sh + npm install -g @anthropic-ai/claude-code + ``` + + *Do NOT install this package as an administrative user, such as `root`. This can compromise the security and stability of your system.* + +2. Navigate to your project directory and run claude. + 3. Complete the one-time OAuth process with your Anthropic Console account. ### Research Preview From 1c6ab88c83a58682a90678ebb896951d7458be3c Mon Sep 17 00:00:00 2001 From: Eric McDonald Date: Fri, 28 Feb 2025 05:15:32 -0800 Subject: [PATCH 2/2] README: Address review comments. --- README.md | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 9698b70a..aa5976de 100644 --- a/README.md +++ b/README.md @@ -17,28 +17,21 @@ Some of its key capabilities include: ## Get started -1. Install Claude Code using one of these methods: +1. If you are new to Node.js and Node Package Manager (`npm`), then it is recommended that you configure an NPM prefix for your user. + Instructions on how to do this can be found [here](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview#recommended-create-a-new-user-writable-npm-prefix). + + *Important* We recommend installing this package as a non-privileged user, not as an administrative user like `root`. + Installing as a non-privileged user helps maintain your system's security and stability. + +2. Install Claude Code: - **User-level installation** (recommended, no `sudo` required): - ```sh - mkdir -p ~/.local/share/npm-packages - npm config set prefix ~/.local/share/npm-packages - export PATH=~/.local/share/npm-packages/bin:$PATH - npm install -g @anthropic-ai/claude-code - ``` - - *Add `export PATH=~/.local/share/npm-packages/bin:$PATH` to your `~/.bashrc` or `~/.zshrc` to make the change permanent.* - - **Installation inside of a virtual environment** (from `nvm`, etc...): ```sh npm install -g @anthropic-ai/claude-code ``` - *Do NOT install this package as an administrative user, such as `root`. This can compromise the security and stability of your system.* +3. Navigate to your project directory and run claude. -2. Navigate to your project directory and run claude. - -3. Complete the one-time OAuth process with your Anthropic Console account. +4. Complete the one-time OAuth process with your Anthropic Console account. ### Research Preview