Migrating Claude Code from npm Global Install to Native Install

Tadashi Shigeoka ·  Sun, January 25, 2026

This article explains how to migrate Claude Code from npm global install to native install.

Background

When launching Claude Code, the following message was displayed:

Claude Code has switched from npm to native installer. Run claude install or see https://docs.anthropic.com/en/docs/claude-code/getting-started for more options.

This means that Claude Code, which was previously installed via Node.js package manager (npm) using npm install -g @anthropic-ai/claude-code, has now switched to using a dedicated native installer.

Benefits of the Native Installer

The migration to the native installer offers the following benefits:

  • No more dependency on Node.js environment: The npm version required Node.js installation, but the native version does not
  • Simplified version management: No need to worry about conflicts with Node.js version management tools like asdf or nvm
  • Automatic updates: Easier updates through the native installer

Migration Steps

Following the instructions and running claude install will install the native version to ~/.local/bin/claude.

However, in environments where Node.js is managed with asdf, running which claude may still prioritize the asdf shim (~/.asdf/shims/claude), causing the old npm version to continue being called.

The following steps will resolve this issue.

1. Check Node.js versions installed with asdf

asdf list nodejs

2. Uninstall claude-code from each version

With asdf, global packages are managed per Node.js version. Therefore, you need to uninstall @anthropic-ai/claude-code from all versions you’ve used in the past.

One-liner to execute in batch:

for version in $(asdf list nodejs | tr -d ' *'); do
  echo "Uninstalling from nodejs $version..."
  ASDF_NODEJS_VERSION=$version npm uninstall -g @anthropic-ai/claude-code 2>/dev/null
done

3. Regenerate asdf shims

asdf reshim nodejs

4. Manually delete old shim file if it remains

If the shim still remains after the above steps, delete it manually.

rm -f ~/.asdf/shims/claude

5. Verify

which claude
# Expected: /Users/<username>/.local/bin/claude
 
claude --version

If ~/.local/bin/claude is displayed, the native installer version is being used correctly.

About PATH Priority

If ~/.local/bin is set after asdf shims in your PATH, check and adjust the order in your shell configuration file (.zshrc or .bashrc).

# Load ~/.local/bin first
export PATH="$HOME/.local/bin:$PATH"

After making changes, restart your shell or run source ~/.zshrc to apply the settings.

Conclusion

With Claude Code’s migration to the native installer, the dependency on Node.js environment has been removed, making it simpler to use.

asdf users need to be aware of the shim priority issue, but following the steps in this article will ensure a smooth migration.

For more details, refer to the Claude Code official documentation.

That’s all from the Gemba, where we migrated Claude Code to native install.