つまずき解決
こういう時は、こうする
エラーで止まった時に、まず何を打てばいいかと、それで直らない時の見分け方を1ページに1つずつまとめています。 画面は手元で実際に出したものだけです。仕組みから知りたい時は図解シリーズへ。
AI のコーディングツール
Claude Code などを入れて、動かすまで
Claude Code・Codex を Mac に入れたいAI ツールを Mac に入れるzsh: command not found: claudecommand not found: claude
仕組みから:AI への聞き方・AI のコードを読む
Git
push できない・取り消したい・画面が閉じない
git branch -d で error: the branch 'x' is not fully merged と出て消せないbranch -d で not fully mergedgit switch で fatal: invalid reference: <name> と出て枝に移れないgit switch で invalid reference消してしまったファイルを、git で元に戻したいgit で削除したファイルを戻すremote: Repository not found. / fatal: repository '...' not foundgit clone で Repository not foundgit merge で Already up to date. と出て、取り込みたい変更が入らないmerge で Already up to date.[email protected]: Permission denied (publickey).Permission denied (publickey)コミットの名前・メールを確かめたい・変えたいコミットの名前・メールを確かめる・変えるfatal: not a git repository (or any of the parent directories): .gitnot a git repository を直すerror: remote origin already exists.remote origin already existsgit stash でしまった変更を、元に戻したいgit stash を戻すgit add したファイルを、add する前に戻したいgit add を取り消すpush してしまったコミットを取り消したいcommit を取り消す(push 後)You are in 'detached HEAD' state と出た/HEAD detached at と表示されるdetached HEAD を解消する.gitignore に書いたのに、git status に出る・コミットされる.gitignore が効かないさっきの git commit を取り消したいcommit を取り消す(push 前)fatal: Authentication failed for https://github.com/...git push で Authentication failederror: src refspec main does not match any初めての git push が通らないgit merge で開いた画面(vim)が閉じられないgit で開いた vim を閉じる
仕組みから:Git 入門・Git ブランチ入門
ターミナル
コマンドが見つからない・止まらない
zsh: no matches found: requests[socks]zsh: no matches foundMac の zsh で環境変数・PATH を設定したのに効かない/新しいタブで消えるzsh で環境変数・PATH が効かないzsh: command not found: brewcommand not found: brewcd: no such file or directory: cafecd: no such file or directorynpm run dev(開発サーバー)が止まらない・ターミナルが入力を受け付けないnpm run dev を止める
仕組みから:ターミナル入門
Python のエラー
入れたのに動かない・pip が通らない
FileNotFoundError: [Errno 2] No such file or directory: 'data.csv'FileNotFoundError: No such fileModuleNotFoundError: No module named 'utils'(自分で作った utils.py)自作ファイルが import できないAttributeError: module 'random' has no attribute 'randint'module has no attribute.env に書いた値が os.getenv で None になる.env が Python で読めないrequests.exceptions.SSLError: ... [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failedPython の SSL 証明書エラーzsh: permission denied: venv/bin/activateactivate が permission deniedzsh: command not found: pipzsh: command not found: pipNameError: name 'x' is not definedNameError: name is not definedpip install requests と打つと SyntaxError: invalid syntaxpip install で SyntaxErrorUnicodeDecodeError: 'utf-8' codec can't decode byte 0x8f in position 0: invalid start byteCSV の UnicodeDecodeErrorerror: externally-managed-environmentexternally-managed-environmentModuleNotFoundError: No module named 'requests'入れたのに ModuleNotFoundError
仕組みから:エラーの読み方・API と JSON
Node.js・npm
npm install が通らない・モジュールがない
npm run dev で npm error Missing script: "dev" と出るnpm error Missing script: "dev"npm run dev で sh: vite: command not foundsh: vite: command not found.env に書いた値が、Vite・Next.js の画面側で undefined になる.env の値が undefinedzsh: command not found: npx(npm・node も同じ)command not found: npxnode_modules を消して、npm install をやり直したいnode_modules を消して入れ直すnpm install で npm error code ERESOLVE(unable to resolve dependency tree)npm error code ERESOLVE
仕組みから:環境のちがい
Web の表示・公開
変えたのに反映されない・データが読めない
Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')Cannot read properties of nullUncaught TypeError: xxx is not a functionxxx is not a functionブラウザに ERR_CONNECTION_REFUSED(localhost で接続が拒否されました)と出るlocalhost で接続が拒否されたAccess to fetch at '...' from origin '...' has been blocked by CORS policyCORS エラーimg を書いたのに画像が出ない(壊れた画像のマーク・alt の文字だけ)HTML の画像が表示されないCSS を変えたのに見た目が変わらないCSS が反映されないSyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSONUnexpected token < in JSON
仕組みから:Web の仕組み・公開(デプロイ)・Cookie とログイン