我试图创建一个nextjs应用程序;当我运行npm run dev
时,我得到了以下错误消息:<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies
v16.13.1
然后我尝试调试并添加了我的next.config.js:
webpack(config){
config.infrastructureLogging = { debug: /PackFileCache/ }
return config;}
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
[webpack.cache.PackFileCacheStrategy] No pack exists at W:\react\cours-nextjs\.next\cache\webpack\client-development.pack: Error: ENOENT: no such file or directory, stat 'W:\react\cours-nextjs\.next\cache\webpack\client-development\index.pack'
<t> [webpack.cache.PackFileCacheStrategy] restore cache container: 30.4758 ms
[webpack.cache.PackFileCacheStrategy] No pack exists at W:\react\cours-nextjs\.next\cache\webpack\server-development.pack: Error: ENOENT: no such file or directory, stat 'W:\react\cours-nextjs\.next\cache\webpack\server-development\index.pack'
<t> [webpack.cache.PackFileCacheStrategy] restore cache container: 30.259 ms
event - compiled client and server successfully in 3.1s (207 modules)
[webpack.cache.PackFileCacheStrategy] Pack got invalid because of write to: ResolverCachePlugin|normal|dependencyType=|esm|path=|W:\react\cours-nextjs|request=|W:\react\cours-nextjs\node_modules\@next\react-refresh-utils\runtime.js
[webpack.cache.PackFileCacheStrategy] Storing pack...
[webpack.cache.PackFileCacheStrategy] Capturing build dependencies... (W:\react\cours-nextjs\next.config.js, W:\react\cours-nextjs\node_modules\next\dist\compiled\, W:\react\cours-nextjs\node_modules\next\dist\build\webpack\loaders\next-client-pages-loader.js, W:\react\cours-nextjs\node_modules\@next\react-refresh-utils\loader.js, W:\react\cours-nextjs\node_modules\next\dist\build\webpack\loaders\next-swc-loader.js, W:\react\cours-nextjs\node_modules\next\dist\build\webpack\loaders\next-style-loader\index.js, W:\react\cours-nextjs\node_modules\next\dist\build\webpack\loaders\css-loader\src\index.js, W:\react\cours-nextjs\node_modules\next\dist\build\webpack\loaders\postcss-loader\src\index.js)
[webpack.cache.PackFileCacheStrategy] Pack got invalid because of write to: ResolverCachePlugin|normal|dependencyType=|esm|path=|W:\react\cours-nextjs|request=|private-next-pages/_app
[webpack.cache.PackFileCacheStrategy] Storing pack...
[webpack.cache.PackFileCacheStrategy] Capturing build dependencies... (W:\react\cours-nextjs\next.config.js, W:\react\cours-nextjs\node_modules\next\dist\compiled\, W:\react\cours-nextjs\node_modules\next\dist\build\webpack\loaders\next-swc-loader.js, W:\react\cours-nextjs\node_modules\next\dist\compiled\ignore-loader\index.js, W:\react\cours-nextjs\node_modules\next\dist\build\webpack\loaders\css-loader\src\index.js, W:\react\cours-nextjs\node_modules\next\dist\build\webpack\loaders\postcss-loader\src\index.js)
<t> [webpack.cache.PackFileCacheStrategy] resolve build dependencies: 349.5088 ms
[webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Error snapshotting file timestamp hash combination of W:\react\cours-nextjs: Error: EINVAL: invalid argument, read
<t> [webpack.cache.PackFileCacheStrategy] snapshot build dependencies: 8.2939 ms
<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies
[webpack.cache.PackFileCacheStrategy] Error: Unable to snapshot resolve dependencies
at W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:67456:13
at jobError (W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:44464:5)
at W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:44527:10
at W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:45420:13
at W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:122829:5
at Hook.eval [as callAsync] (eval at create (W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:141512:10), <anonymous>:6:1)
at AsyncQueue._handleResult (W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:122799:21)
at W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:122782:11
at W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:45369:12
at W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:20032:16
[webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Error snapshotting file timestamp hash combination of W:\react: Error: EINVAL: invalid argument, read
[webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Error snapshotting file timestamp hash combination of W:\react\cours-nextjs\node_modules\@next: Error: EINVAL: invalid argument, read
[webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Error snapshotting file timestamp hash combination of W:\: Error: EINVAL: invalid argument, read
[webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Error snapshotting file timestamp hash combination of W:\react\cours-nextjs\node_modules: Error: EINVAL: invalid argument, read
[webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Error snapshotting file timestamp hash combination of W:\react\cours-nextjs\node_modules\@napi-rs: Error: EINVAL: invalid argument, read
<t> [webpack.cache.PackFileCacheStrategy] resolve build dependencies: 314.5233 ms
[webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Error snapshotting file timestamp hash combination of W:\react\cours-nextjs: Error: EINVAL: invalid argument, read
<t> [webpack.cache.PackFileCacheStrategy] snapshot build dependencies: 3.9051 ms
<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies
[webpack.cache.PackFileCacheStrategy] Error: Unable to snapshot resolve dependencies
at W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:67456:13
at jobError (W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:44464:5)
at W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:44527:10
at W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:45420:13
at W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:122829:5
at Hook.eval [as callAsync] (eval at create (W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:141512:10), <anonymous>:6:1)
at AsyncQueue._handleResult (W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:122799:21)
at W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:122782:11
at W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:45369:12
at W:\react\cours-nextjs\node_modules\next\dist\compiled\webpack\bundle5.js:20032:16
[webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Error snapshotting file timestamp hash combination of W:\react: Error: EINVAL: invalid argument, read
[webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Error snapshotting file timestamp hash combination of W:\react\cours-nextjs\node_modules: Error: EINVAL: invalid argument, read
[webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Error snapshotting file timestamp hash combination of W:\: Error: EINVAL: invalid argument, read
[webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Error snapshotting file timestamp hash combination of W:\react\cours-nextjs\node_modules\@next: Error: EINVAL: invalid argument, read
[webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Error snapshotting file timestamp hash combination of W:\react\cours-nextjs\node_modules\@napi-rs: Error: EINVAL: invalid argument, read
W:\react\cours-nextjs (main)
λ [webpack.cache.PackFileCacheStrategy] No pack exists at W:\react\cours-nextjs\.next\cache\webpack\client-development.pack: Error: ENOENT: no such file or directory, stat 'W:\react\cours-nextjs\.next\cache\webpack\client-development\index.pack'
谢谢你的帮忙
发布于 2022-05-07 08:43:47
将项目目录从W:/驱动器更改为C:/驱动器。这很蠢但很管用。
https://stackoverflow.com/questions/70510795
复制相似问题