首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 ><w> [webpack.cache.PackFileCacheStrategy]缓存失败:错误:无法快照解析依赖项

<w> [webpack.cache.PackFileCacheStrategy]缓存失败:错误:无法快照解析依赖项
EN

Stack Overflow用户
提问于 2022-08-10 12:25:55
回答 2查看 1.4K关注 0票数 3

试着在我的VPS上运行一个项目,但是我总是把这个错误标记出来。我尝试过清理和安装所有新鲜的东西,但问题仍然出现。任何帮助都将不胜感激。

代码语言:javascript
运行
复制
<t> [webpack.cache.PackFileCacheStrategy] restore cache container: 64.298367 ms
info  - Creating an optimized production build ...    [webpack.cache.PackFileCacheStrategy] Pack got invalid because of write to: Compilation/modules|/home/admin/web/server/public_html/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[2].oneOf[2].use!/home/admin/web/server/public_html/node_modules/next/dist/pages/_error.js
    [webpack.cache.PackFileCacheStrategy] Storing pack...
    [webpack.cache.PackFileCacheStrategy] Capturing build dependencies... (/home/admin/web/server/public_html/next.config.js, /home/admin/web/server/public_html/node_modules/next/dist/compiled/, /home/admin/web/server/public_html/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js)
info  - Creating an optimized production build .<t> [webpack.cache.PackFileCacheStrategy] resolve build dependencies: 90.189044 ms
    [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Error snapshotting file timestamp hash combination of /home/admin: Error: EACCES: permission denied, open '/home/admin'
<t> [webpack.cache.PackFileCacheStrategy] snapshot build dependencies: 1.801434 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 /home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:70754:13
        at jobError (/home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:47008:5)
        at /home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:47071:10
        at /home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:47968:13
        at /home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:131419:5
        at Hook.eval [as callAsync] (eval at create (/home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:23493:10), <anonymous>:6:1)
        at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:23295:14)
        at AsyncQueue._handleResult (/home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:131389:21)
        at /home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:131372:11
        at ReadFileContext.<anonymous> (/home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:47917:12)
    [webpack.cache.PackFileCacheStrategy] No pack exists at /home/admin/web/server/public_html/.next/cache/webpack/edge-server-production.pack: Error: ENOENT: no such file or directory, stat '/home/admin/web/server/public_html/.next/cache/webpack/edge-server-production/index.pack'
<t> [webpack.cache.PackFileCacheStrategy] restore cache container: 19.478739 ms
    [webpack.cache.PackFileCacheStrategy] No pack exists at /home/admin/web/server/public_html/.next/cache/webpack/client-production.pack: Error: ENOENT: no such file or directory, stat '/home/admin/web/server/public_html/.next/cache/webpack/client-production/index.pack'
<t> [webpack.cache.PackFileCacheStrategy] restore cache container: 9.156366 ms
info  - Creating an optimized production build ...    [webpack.cache.PackFileCacheStrategy] Pack got invalid because of write to: Compilation/modules|/home/admin/web/server/public_html/node_modules/next/dist/build/webpack/loaders/next-client-pages-loader.js?absolutePagePath=next%2Fdist%2Fpages%2F_app&page=%2F_app!
    [webpack.cache.PackFileCacheStrategy] Storing pack...
    [webpack.cache.PackFileCacheStrategy] Capturing build dependencies... (/home/admin/web/server/public_html/next.config.js, /home/admin/web/server/public_html/node_modules/next/dist/compiled/, /home/admin/web/server/public_html/node_modules/next/dist/build/webpack/loaders/next-client-pages-loader.js, /home/admin/web/server/public_html/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js)
info  - Creating an optimized production build .<t> [webpack.cache.PackFileCacheStrategy] resolve build dependencies: 102.05922 ms
    [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Error snapshotting file timestamp hash combination of /home/admin: Error: EACCES: permission denied, open '/home/admin'
<t> [webpack.cache.PackFileCacheStrategy] snapshot build dependencies: 2.324734 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 /home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:70754:13
        at jobError (/home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:47008:5)
        at /home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:47071:10
        at /home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:47968:13
        at /home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:131419:5
        at Hook.eval [as callAsync] (eval at create (/home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:23493:10), <anonymous>:6:1)
        at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:23295:14)
        at AsyncQueue._handleResult (/home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:131389:21)
        at /home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:131372:11
        at ReadFileContext.<anonymous> (/home/admin/web/server/public_html/node_modules/next/dist/compiled/webpack/bundle5.js:47917:12)```
EN

回答 2

Stack Overflow用户

发布于 2022-11-06 11:52:15

正如这一讨论中所述,在您的案例中,合适的解决方案似乎是

代码语言:javascript
运行
复制
cd [your project]
npm install -g n
sudo n stable
rm -rf node_modules/
rm -f package-lock.json
npm install

我真的不能重现这个错误,所以我不能百分之百地相信这会成功,但是你可以试一试,让我们知道。我也认为你可以跳过一个稳定的节点版本的安装,所以,如果你已经有了,就试试干净的npm安装吧。

票数 1
EN

Stack Overflow用户

发布于 2022-11-27 17:54:45

对我来说,我只是把我的项目移到C:/,然后回去工作。但是,如果您需要在另一个磁盘中维护该项目,则可以这样做:

  • 转到your_project/node_modules/next/package.json
  • _where (当地包件)中更改本地
  • 现在你可以开始了。

我不知道发生了什么事,也不知道改变这个包裹的不同形式。

PS 2.:我搜索了很多,但没有找到任何东西。

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

https://stackoverflow.com/questions/73306304

复制
相关文章

相似问题

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