[Bug] `npm install` in a sample directory without first `pnpm install` in root project results in `husky not found` error

未关闭
#411 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
typescript
领域
build-system

调研方向

从根项目的 install 和 prepare 生命周期以及 hello-world 示例使用的软件包配置入手。在全新克隆中于 hello-world 内执行 npm install 以重现问题,然后追踪为什么在 husky 不可用的情况下仍会运行 husky install。当示例目录中记录的安装过程无需事先在根目录执行 pnpm install 即可成功完成时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

bug
Describe the bug

Since the refactor of the root project to be a PNPM workspace, running npm install in a single sample directory from a fresh git clone of the repository (i.e. without first running pnpm install in the root project) results in an error message to the effect that husky is missing.

How to reproduce
git clone github.com/temporalio/samples-typescript.git
cd samples-typescript/hello-world
npm install

results in

[...]

> prepare
> husky install

sh: husky: command not found
npm error code 127
npm error path /[...]/samples-typescript
npm error command failed
npm error command sh -c husky install
Extra
  • We may want to revert #405. That fix probably incorrect.
主要语言
TypeScript
星标
470
派生
150
平均合并
2 天 16 小时
30 天内合并 PR
3

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

temporalio/samples-typescript 的其他 Issue

查看 temporalio/samples-typescript 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。