【问题标题】:NestJS doesn't start within appsNestJS 不在应用程序中启动
【发布时间】:2022-01-23 23:20:33
【问题描述】:

我最近开始使用 turborepo。 我通过执行以下操作在/apps 目录中添加了一个名为api 的新应用

$ cd apps
$ nest new api

现在如果我尝试运行 nest api

$ cd api
$ yarn start:dev

它失败并出现以下错误,

../../node_modules/@types/react-dom/node_modules/@types/react/index.d.ts:3100:14 - error         type LibraryManagedAttributes<C, P>dAttributes'.
                  ~~~~~~~~~~~~~~~~~~~~~~~~
3100
  ../../node_modules/@types/react/index.d.ts:3100:14
    3100         type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
                      ~~~~~~~~~~~~~~~~~~~~~~~~
    'LibraryManagedAttributes' was also declared here.

../../node_modules/@types/react/index.d.ts:3100:14 - error TS2300: Duplicate identifier 'LibraryManagedAttributes'.

3100         type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
                  ~~~~~~~~~~~~~~~~~~~~~~~~

  ../../node_modules/@types/react-dom/node_modules/@types/react/index.d.ts:3100:14
    3100         type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
                      ~~~~~~~~~~~~~~~~~~~~~~~~
    'LibraryManagedAttributes' was also declared here.

[4:35:02 PM] Found 2 errors. Watching for file changes.


救命!

【问题讨论】:

    标签: nestjs turborepo


    【解决方案1】:

    apps/api 中更改 tsconfig.json 后,我让它工作了

    {
      "extends": "tsconfig/base.json",
      "include": [
        "./**/*.ts"
      ],
      "exclude": [
        "node_modules"
      ],
      "compilerOptions": {
        "module": "commonjs",
        "declaration": true,
        "removeComments": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "allowSyntheticDefaultImports": true,
        "target": "es2017",
        "sourceMap": true,
        "outDir": "./dist",
        "baseUrl": "./",
        "incremental": true
      }
    }
    
    

    【讨论】:

    猜你喜欢
    • 2021-04-07
    • 2019-08-02
    • 2022-07-13
    • 1970-01-01
    • 1970-01-01
    • 2021-06-29
    • 1970-01-01
    • 1970-01-01
    • 2022-08-18
    相关资源
    最近更新 更多