afc163 / fanyi

A 🇨🇳 and 🇺🇸 translator in your command line
https://npmjs.com/fanyi
MIT License
1.44k stars 137 forks source link

Error: Cannot find module 'ora' #111

Closed yunsii closed 2 months ago

yunsii commented 2 months ago
➜ fy --version
9.0.1

➜ fy love     
node:internal/modules/cjs/loader:1225
  const err = new Error(message);
              ^

Error: Cannot find module 'ora'
Require stack:
- /home/yuns/.config/nvm/versions/node/v20.17.0/lib/node_modules/fanyi/index.js
- /home/yuns/.config/nvm/versions/node/v20.17.0/lib/node_modules/fanyi/bin/fanyi.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Module._load (node:internal/modules/cjs/loader:1051:27)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/home/yuns/.config/nvm/versions/node/v20.17.0/lib/node_modules/fanyi/index.js:5:13)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/yuns/.config/nvm/versions/node/v20.17.0/lib/node_modules/fanyi/index.js',
    '/home/yuns/.config/nvm/versions/node/v20.17.0/lib/node_modules/fanyi/bin/fanyi.js'
  ]
}

Node.js v20.17.0

https://github.com/afc163/fanyi/blob/578f859a9f5ea010813138de04ba5c6f8d7945c3/package.json#L40-L48

为什么 ora 是开发环境依赖啊 :sweat_smile:

gitauto-ai[bot] commented 2 months ago

Welcome to GitAuto! 🎉 Click the checkbox below to generate a PR!

@yunsii, You have 5 requests left in this cycle which refreshes on 2024-10-06 01:47:00+00:00. If you have any questions or concerns, please contact us at info@gitauto.ai.

dosubot[bot] commented 2 months ago

Hey @yunsii! I'm here to help you with any bugs, questions, or contributions you have for the fanyi project. Let's squash those bugs together!

ora 被列为开发环境依赖是因为它在 package.json 文件中的 devDependencies 部分:

"devDependencies": {
  "@biomejs/biome": "^1.9.0",
  "c8": "^10.1.2",
  "husky": "^9.1.6",
  "lint-staged": "^15.2.10",
  "np": "^10.0.7",
  "ora": "^4.1.1",
  "vitest": "^2.1.0"
}

这意味着 ora 主要用于开发过程中的任务,例如在命令行界面中显示加载动画等[1]

你遇到的错误表明 ora 模块缺失,这可能是因为它没有在你的环境中安装。要解决这个问题,你可以在项目目录中运行 npm installyarn install 来安装开发依赖。

To continue talking to Dosu, mention @dosu.

afc163 commented 2 months ago

Fixed in https://github.com/afc163/fanyi/releases/tag/v9.0.2

gitauto-ai[bot] commented 2 months ago

@yunsii @afc163 Pull request completed! Check it out here https://github.com/afc163/fanyi/pull/113 🚀 Should you have any questions or wish to change settings or limits, please feel free to contact info@gitauto.ai or invite us to Slack Connect.