failed to solve: process "/bin/sh -c npm install" did not complete successfully: exit code 1 の原因と解決法
failed to solve: process "/bin/sh -c npm install" did not complete successfully: exit code 1 の原因と具体的な解決手順をまとめました。
エラーメッセージ(全文)
failed to solve: process "/bin/sh -c npm install" did not complete successfully: exit code 1
このエラーとは
failed to solve: process "/bin/sh -c npm install" did not complete successfully: exit code 1 は Docker 開発でよく遭遇するエラーです。
想定環境: Windows / macOS / Linux
よく出る状況: docker run / build / compose 時
よくある原因
- デーモン停止
- ポート競合
- Dockerfile ビルド失敗
- ディスク不足
解決方法
方法1: デーモン確認
sudo systemctl status docker
sudo systemctl start docker方法2: ポート変更
-p 8080:80 など別ポートにマッピング.
それでも直らないとき
バージョン情報(Docker のバージョン、OS、実行コマンド)を添えて、エラーメッセージ全文と直前に変更した点を確認してください。ログの数行上にも原因の手がかりが残っていることが多いです。
まとめ
「failed to solve: process "/bin/sh -c npm install" did not complete successfully: exit code 1」は デーモン停止 が原因のことが多いです。上記の手順で切り分けてください。
次にやること
同じ Docker カテゴリの関連エラーもあわせて確認してください。
よくある質問
failed to solve: process "/bin/sh -c npm install" did not complete successful… とは何ですか?
failed to solve: process "/bin/sh -c npm install" did not complete successfully: exit code 1 は Docker 実行時に表示されるエラーです。デーモン停止
failed to solve: process "/bin/sh -c npm install" did not complete successful… の原因は?
デーモン停止。ポート競合。Dockerfile ビルド失敗。
failed to solve: process "/bin/sh -c npm install" did not complete successful… の直し方は?
デーモン確認:sudo systemctl status docker ポート変更:-p 8080:80 など別ポートにマッピング.
Docker で failed to solve が出るのはなぜ?
docker run / build / compose 時
failed to solve: process "/bin/sh -c npm install" did not complete successful… を防ぐには?
。
次に読むべき記事
- ERROR [internal] load metadata for docker.io/library/node:20 の原因と解決法
- denied: requested access to the resource is denied の原因と解決法
- image with reference was found but does not match the specified platform の原因と解決法
- failed to solve: alpine:3.423-alpine: failed to resolve source metadata for docker.io/library/alpine の原因と解決法
- failed to solve: postgres:3.411-alpine: failed to resolve source metadata for docker.io/library/postgres の原因と解決法
同カテゴリ「Dockerエラー」の記事
- docker: Error response from daemon: mkdir /var/lib/docker/overlay2/xxx/merged: no space left on device の原因と解決法
- docker: Error response from daemon: driver failed programming external connectivity の原因と解決法
- Error response from daemon: pull access denied for prom/prometheus, repository does not exist or may require 'docker login' の原因と解決法
- Error response from daemon: pull access denied for grafana/grafana, repository does not exist or may require 'docker login' の原因と解決法
- OCI runtime create failed: runc create failed: unable to start container process: exec: "npm": executable file not found の原因と解決法
- docker compose: service "web" depends on undefined service "db": invalid compose project の原因と解決法
人気記事
- TS2307: Cannot find module '@components/Widget601' or its corresponding type declarations の原因と解決法
- TS2307: Cannot find module '@components/Widget591' or its corresponding type declarations の原因と解決法
- TS2307: Cannot find module '@components/Widget581' or its corresponding type declarations の原因と解決法
- TS2307: Cannot find module '@components/Widget571' or its corresponding type declarations の原因と解決法
- TS2307: Cannot find module '@components/Widget561' or its corresponding type declarations の原因と解決法
- TS2307: Cannot find module '@components/Widget551' or its corresponding type declarations の原因と解決法
学習ルート
体系的に学びたい方はこちらから。
エラー・トラブル集で続きを探す →あわせて読みたい
- failed to solve: alpine:3.423-alpine: failed to resolve source metadata for docker.io/library/alpine の原因と解決法同カテゴリの関連エラー
- failed to solve: postgres:3.411-alpine: failed to resolve source metadata for docker.io/library/postgres の原因と解決法同カテゴリの関連エラー
- failed to solve: alpine:3.399-alpine: failed to resolve source metadata for docker.io/library/alpine の原因と解決法同カテゴリの関連エラー
- failed to solve: postgres:3.387-alpine: failed to resolve source metadata for docker.io/library/postgres の原因と解決法同カテゴリの関連エラー
- failed to solve: alpine:3.375-alpine: failed to resolve source metadata for docker.io/library/alpine の原因と解決法同カテゴリの関連エラー