gpt4 book ai didi

typescript 不忽略 node_modules

转载 作者:行者123 更新时间:2023-12-03 14:33:36 27 4
gpt4 key购买 nike

我的目录结构:

  • 前端

    -- node_modules
  • 后端

    -- node_modules
  • tsconfig.json

  • 在我的 tsconfig.json 中,我有:
    "exclude": [
    "frontend/node_modules", "backend/node_modules"
    ]

    尽管如此,我还是从 node_modules 中的包中得到错误。

    我究竟做错了什么?

    //每

    最佳答案

    为什么"exclude"不起作用:

    "exclude" only prevents items from being included by "include"; it doesn't prevent them from being included via import statements or <reference>s. If you import [the module] levelup, and levelup imports leveldown, then excluding leveldown or node_modules won't have an effect. (reddit)


    TS 引用: https://www.typescriptlang.org/tsconfig#exclude
    也许你应该试试 the option --skipLibCheck .
    另请参阅常见问题解答: Why is a file in the exclude list still picked up by the compiler?

    关于 typescript 不忽略 node_modules,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54124361/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com