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

master 分支上克隆并使用生产版本安装依赖会产生错误:找不到模块 husky #12686

Closed
1 task done
dousha opened this issue Jun 21, 2023 · 0 comments
Closed
1 task done
Labels
RSS bug Something isn't working

Comments

@dousha
Copy link
Contributor

dousha commented Jun 21, 2023

路由地址

NOROUTE

完整路由地址

NOROUTE

相关文档

https://docs.rsshub.app/usage.html

预期是什么?

执行以下指令时,命令应当可以成功完成:

$ pnpm install -P

实际发生了什么?

由于 husky 是开发依赖,它将不会在生产环境中被安装。但是准备脚本 ./scripts/prepare.js 是需要该模块的,故报错终止。

目前的 workaround 是安装所有依赖项目,包含开发依赖。

部署

自建

部署相关信息

OS: CentOS 7, Node: 16.17.0

额外信息

$ sudo -u rsshub /opt/pnpm install -P
Lockfile is up to date, resolution step is skipped
Packages: +675

---8<---

devDependencies: skipped

> rsshub@1.0.0 prepare /opt/RSSHub
> node ./scripts/prepare.js

node:internal/modules/cjs/loader:959
  throw err;
  ^

Error: Cannot find module 'husky'
Require stack:
- /opt/RSSHub/scripts/prepare.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
    at Function.Module._load (node:internal/modules/cjs/loader:804:27)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/opt/RSSHub/scripts/prepare.js:3:5)
    at Module._compile (node:internal/modules/cjs/loader:1126:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/opt/RSSHub/scripts/prepare.js' ]
}

ELIFECYCLE  Command failed with exit code 1.

这不是重复的 issue

  • 我已经搜索了现有 issue,以确保该错误尚未被报告。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RSS bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant