首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在创建nextjs应用程序时,消息‘pack缓存失败: Error:无法快照解析依赖’

在创建nextjs应用程序时,消息‘pack缓存失败: Error:无法快照解析依赖’
EN

Stack Overflow用户
提问于 2021-12-28 17:59:53
回答 1查看 1.1K关注 0票数 0

我试图创建一个nextjs应用程序;当我运行npm run dev时,我得到了以下错误消息:<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies

v16.13.1

  • version of npm:
  1. 版本的Node.js : v8.3.0

然后我尝试调试并添加了我的next.config.js:

代码语言:javascript
运行
复制
webpack(config){
     config.infrastructureLogging = { debug: /PackFileCache/ }
        return config;}
代码语言:javascript
运行
复制
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'

谢谢你的帮忙

EN

回答 1

Stack Overflow用户

发布于 2022-05-07 08:43:47

将项目目录从W:/驱动器更改为C:/驱动器。这很蠢但很管用。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70510795

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档