File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,15 +36,24 @@ Create a wrapper script (e.g. `~/bin/claude-fixed`):
3636
3737``` bash
3838#! /bin/bash
39- CLAUDE_NPM_CLI=" $HOME /.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js"
39+ NPM_GLOBAL_ROOT=" $( npm root -g 2> /dev/null) "
40+
41+ CLAUDE_NPM_CLI=" $NPM_GLOBAL_ROOT /@anthropic-ai/claude-code/cli.js"
42+ CACHE_FIX=" $NPM_GLOBAL_ROOT /claude-code-cache-fix/preload.mjs"
4043
4144if [ ! -f " $CLAUDE_NPM_CLI " ]; then
4245 echo " Error: Claude Code npm package not found at $CLAUDE_NPM_CLI " >&2
4346 echo " Install with: npm install -g @anthropic-ai/claude-code" >&2
4447 exit 1
4548fi
4649
47- exec env NODE_OPTIONS=" --import claude-code-cache-fix" node " $CLAUDE_NPM_CLI " " $@ "
50+ if [ ! -f " $CACHE_FIX " ]; then
51+ echo " Error: claude-code-cache-fix not found at $CACHE_FIX " >&2
52+ echo " Install with: npm install -g claude-code-cache-fix" >&2
53+ exit 1
54+ fi
55+
56+ exec env NODE_OPTIONS=" --import $CACHE_FIX " node " $CLAUDE_NPM_CLI " " $@ "
4857```
4958
5059``` bash
You can’t perform that action at this time.
0 commit comments