网站搜索

yarnpkg - TypeScript 编译器 (tsc) 抛出错误,但仅在 yarn 脚本中使用时出现,其他情况正常


如果我执行:

tsc

一切都能编译,没有问题。能够识别 tsconfig.json 中的模式

inside package.json
scripts: { 
  "build" : "tsc" 
}

yarn build

抛出错误。

error TS6307: File '***' is not in project file list. Projects must list all files or use an 'include' pattern.

error Command failed with exit code 2.

这些文件符合模式,因为不使用 yarn 运行 tsc 会产生预期效果。

为什么会这样?

相关文章