0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Webpack】Caching failed for pack: Error: Unable to snapshot resolve dependencies

Posted at

はじめに

開発サーバを起動(npm run dev)した際に遭遇した以下エラーについて、原因と対処法を記載します。

<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies

🪄 概要

上記は、Webpackのキャッシュ機能が依存関係のスナップショット作成に失敗したことを示しています。

主な原因

  • 依存パッケージの破損や不整合
  • node_modulesやpackage-lock.jsonの不整合
  • ファイルやディレクトリのパーミッション問題
  • Webpackや関連プラグインのバージョン不整合

🪄 対処法

1:キャッシュのクリア

rm -rf node_modules/.cache

2:node_modulespackage-lock.jsonの削除&再インストール

rm -rf node_modules package-lock.json

3:開発サーバの再起動

npm run dev

👉 以上です!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?