Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

安装依赖报错 #1759

Closed
Chasen-Zhang opened this issue Jun 27, 2023 · 10 comments
Closed

安装依赖报错 #1759

Chasen-Zhang opened this issue Jun 27, 2023 · 10 comments
Labels
question Further information is requested

Comments

@Chasen-Zhang
Copy link

Chasen-Zhang commented Jun 27, 2023

Question

$ husky install && dumi setup
husky - Git hooks installed
info - dumi v2.2.1
fatal - Error: Register plugin /home/runner/work/x-ui/x-ui/node_modules/dumi/dist/features/autoAlias.js failed, since Cannot find module './util'
Require stack:

  • /home/runner/work/x-ui/x-ui/node_modules/dumi/node_modules/file-system-cache/lib/common/index.js
  • /home/runner/work/x-ui/x-ui/node_modules/dumi/node_modules/file-system-cache/lib/FileSystemCache.js
  • /home/runner/work/x-ui/x-ui/node_modules/dumi/node_modules/file-system-cache/lib/index.js
  • /home/runner/work/x-ui/x-ui/node_modules/dumi/dist/utils.js
  • /home/runner/work/x-ui/x-ui/node_modules/dumi/dist/features/autoAlias.js
  • /home/runner/work/x-ui/x-ui/node_modules/@umijs/core/dist/service/plugin.js
  • /home/runner/work/x-ui/x-ui/node_modules/@umijs/core/dist/service/pluginAPI.js
  • /home/runner/work/x-ui/x-ui/node_modules/@umijs/core/dist/index.js
  • /home/runner/work/x-ui/x-ui/node_modules/dumi/dist/service/service.js
  • /home/runner/work/x-ui/x-ui/node_modules/dumi/dist/service/cli.js
  • /home/runner/work/x-ui/x-ui/node_modules/dumi/dist/cli.js
  • /home/runner/work/x-ui/x-ui/node_modules/dumi/bin/dumi.js
    at Plugin.apply (/home/runner/work/x-ui/x-ui/node_modules/@umijs/core/dist/service/plugin.js:76:15)
    at DumiService.initPlugin (/home/runner/work/x-ui/x-ui/node_modules/@umijs/core/dist/service/service.js:463:33)
    at DumiService.run (/home/runner/work/x-ui/x-ui/node_modules/@umijs/core/dist/service/service.js:259:18)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async DumiService.run2 (/home/runner/work/x-ui/x-ui/node_modules/umi/dist/service/service.js:65:12)
    at async run (/home/runner/work/x-ui/x-ui/node_modules/dumi/dist/service/cli.js:57:7)
    at async /home/runner/work/x-ui/x-ui/node_modules/dumi/dist/cli.js:23:5 {
    [cause]: Error: Cannot find module './util'
    Require stack:
    • /home/runner/work/x-ui/x-ui/node_modules/dumi/node_modules/file-system-cache/lib/common/index.js
    • /home/runner/work/x-ui/x-ui/node_modules/dumi/node_modules/file-system-cache/lib/FileSystemCache.js
    • /home/runner/work/x-ui/x-ui/node_modules/dumi/node_modules/file-system-cache/lib/index.js
    • /home/runner/work/x-ui/x-ui/node_modules/dumi/dist/utils.js
    • /home/runner/work/x-ui/x-ui/node_modules/dumi/dist/features/autoAlias.js
    • /home/runner/work/x-ui/x-ui/node_modules/@umijs/core/dist/service/plugin.js
    • /home/runner/work/x-ui/x-ui/node_modules/@umijs/core/dist/service/pluginAPI.js
    • /home/runner/work/x-ui/x-ui/node_modules/@umijs/core/dist/index.js
    • /home/runner/work/x-ui/x-ui/node_modules/dumi/dist/service/service.js
    • /home/runner/work/x-ui/x-ui/node_modules/dumi/dist/service/cli.js
    • /home/runner/work/x-ui/x-ui/node_modules/dumi/dist/cli.js
    • /home/runner/work/x-ui/x-ui/node_modules/dumi/bin/dumi.js
      at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
      at mod._resolveFilename (/home/runner/work/x-ui/x-ui/node_modules/umi/dist/service/requireHook.js:13:26)
      at Module._load (node:internal/modules/cjs/loader:920:27)
      at Module.require (node:internal/modules/cjs/loader:1141:19)
      at require (node:internal/modules/cjs/helpers:110:18)
      at Object. (/home/runner/work/x-ui/x-ui/node_modules/dumi/node_modules/file-system-cache/lib/common/index.js:30:27)
      at Module._compile (node:internal/modules/cjs/loader:1254:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
      at Module.load (node:internal/modules/cjs/loader:1117:32)
      at Module._load (node:internal/modules/cjs/loader:958:12) {
      code: 'MODULE_NOT_FOUND',
      requireStack: [
      '/home/runner/work/x-ui/x/node_modules/dumi/node_modules/file-system-cache/lib/common/index.js',
      }
      }
      fatal - A complete log of this run can be found in:
      fatal - /home/runner/work/x-ui/x-ui/node_modules/.cache/logger/umi.log
      fatal - Consider reporting a GitHub issue on https://github.com/umijs/dumi/issues
      error Command failed with exit code 1.
      info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

安装依赖报错

@PeachScript 你好,能否帮忙看下这个问题

@Chasen-Zhang Chasen-Zhang added the question Further information is requested label Jun 27, 2023
@Chasen-Zhang
Copy link
Author

"prepare": "dumi setup" 运行这个命令报错,

@Wuriqilang
Copy link

相同错误

@Chasen-Zhang
Copy link
Author

Chasen-Zhang commented Jun 27, 2023

@Wuriqilang
我就这两天报这个错,哥们,你解决了吗

@Chasen-Zhang
Copy link
Author

好像他们不怎么活跃的样子,

@afc163
Copy link
Contributor

afc163 commented Jun 27, 2023

可以去 philcockfield/file-system-cache#30 这里催下。

@Chasen-Zhang
Copy link
Author

可以去 philcockfield/file-system-cache#30 这里催下。

有没有临时的解决方案呢

@afc163
Copy link
Contributor

afc163 commented Jun 27, 2023

@Chasen-Zhang
Copy link
Author

Chasen-Zhang commented Jun 27, 2023

临时解决方案,我是基于yarn安装,在package.json 当中增加resolutions,工作正常

碰到文件大小写系统敏感问题。

 "resolutions": {
    "file-system-cache": "2.3.0"
  }

@Wuriqilang
Copy link

Wuriqilang commented Jun 27, 2023

file-system-cache库 Utils文件大小写导致的问题,我的解决方案是

package.json里添加

  "overrides": {
    "file-system-cache": "2.3.0"
  }

@PeachScript
Copy link
Member

file-system-cache 已发布修复版本 2.4.1,诸位移除临时方案再重新安装依赖即可;如果使用 pnpm 或 yarn 初始化脚手架,需要同步更新 lock 文件避免继续安装到有问题的版本

该 issue 关闭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants