NestJS不会在应用程序中启动



我最近开始使用涡轮回购。我通过执行以下,在/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.

救命!

我在更改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
}
}

最新更新