nestjsx / crud

NestJs CRUD for RESTful APIs
https://github.com/nestjsx/crud/wiki
MIT License
4.09k stars 539 forks source link

[BUG] starting project error #625

Closed zcharym closed 4 years ago

zcharym commented 4 years ago
[System Information]
OS Version: Windows 10
NodeJS Version : v12.16.1
NPM Version    : 6.13.4

[Nest CLI]
Nest CLI Version: 7.5.2

[Nest Platform Information]
@nestjsx/crud-typeorm version : 4.6.2
platform-express version      : 7.5.1
typeorm version               : 7.1.4
common version                : 7.5.1
core version                  : 7.5.1

Error Messages: Cannot find module 'xxx' or its corresponding type declarations.

details:

../node_modules/@nestjs/swagger/dist/decorators/api-body.decorator.d.ts:1:22 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

1 import { Type } from '@nestjs/common';
                       ~~~~~~~~~~~~~~~~

../node_modules/@nestjs/swagger/dist/decorators/api-param.decorator.d.ts:1:22 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

1 import { Type } from '@nestjs/common';
                       ~~~~~~~~~~~~~~~~

../node_modules/@nestjs/swagger/dist/decorators/api-query.decorator.d.ts:1:22 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

1 import { Type } from '@nestjs/common';
                       ~~~~~~~~~~~~~~~~

../node_modules/@nestjs/swagger/dist/decorators/api-response.decorator.d.ts:1:22 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

1 import { Type } from '@nestjs/common';
                       ~~~~~~~~~~~~~~~~

../node_modules/@nestjs/swagger/dist/interfaces/schema-object-metadata.interface.d.ts:1:22 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

1 import { Type } from '@nestjs/common';
                       ~~~~~~~~~~~~~~~~

../node_modules/@nestjs/swagger/dist/swagger-module.d.ts:1:34 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

1 import { INestApplication } from '@nestjs/common';
                                   ~~~~~~~~~~~~~~~~

../node_modules/@nestjs/swagger/dist/type-helpers/intersection-type.helper.d.ts:1:22 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

1 import { Type } from '@nestjs/common';
                       ~~~~~~~~~~~~~~~~

../node_modules/@nestjs/swagger/dist/type-helpers/omit-type.helper.d.ts:1:22 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

1 import { Type } from '@nestjs/common';
                       ~~~~~~~~~~~~~~~~

../node_modules/@nestjs/swagger/dist/type-helpers/partial-type.helper.d.ts:1:22 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

1 import { Type } from '@nestjs/common';
                       ~~~~~~~~~~~~~~~~

../node_modules/@nestjs/swagger/dist/type-helpers/pick-type.helper.d.ts:1:22 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

1 import { Type } from '@nestjs/common';
                       ~~~~~~~~~~~~~~~~

../node_modules/@nestjsx/crud/lib/decorators/feature-action.decorator.d.ts:1:22 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

1 import { Type } from '@nestjs/common';
                       ~~~~~~~~~~~~~~~~

../node_modules/@nestjsx/crud/lib/decorators/feature-action.decorator.d.ts:2:56 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

2 export declare const Feature: (name: string) => import("@nestjs/common").CustomDecorator<string>;
                                                         ~~~~~~~~~~~~~~~~

../node_modules/@nestjsx/crud/lib/decorators/feature-action.decorator.d.ts:3:55 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

3 export declare const Action: (name: string) => import("@nestjs/common").CustomDecorator<string>;
                                                        ~~~~~~~~~~~~~~~~

../node_modules/@nestjsx/crud/lib/interceptors/crud-base.interceptor.d.ts:1:34 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

1 import { ExecutionContext } from '@nestjs/common';
                                   ~~~~~~~~~~~~~~~~

../node_modules/@nestjsx/crud/lib/interceptors/crud-request.interceptor.d.ts:1:64 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

1 import { CallHandler, ExecutionContext, NestInterceptor } from '@nestjs/common';
                                                                 ~~~~~~~~~~~~~~~~

../node_modules/@nestjsx/crud/lib/interceptors/crud-request.interceptor.d.ts:7:69 - error TS2307: Cannot find module 'rxjs' or its corresponding type declarations.

7     intercept(context: ExecutionContext, next: CallHandler): import("rxjs").Observable<any>;
                                                                      ~~~~~~

../node_modules/@nestjsx/crud/lib/interceptors/crud-response.interceptor.d.ts:1:64 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

1 import { CallHandler, ExecutionContext, NestInterceptor } from '@nestjs/common';
                                                                 ~~~~~~~~~~~~~~~~

../node_modules/@nestjsx/crud/lib/interceptors/crud-response.interceptor.d.ts:2:28 - error TS2307: Cannot find module 'rxjs' or its corresponding type declarations.

2 import { Observable } from 'rxjs';
                             ~~~~~~

../node_modules/@nestjsx/crud/lib/interfaces/base-route.interface.d.ts:1:31 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

1 import { RequestMethod } from '@nestjs/common';
                                ~~~~~~~~~~~~~~~~

../node_modules/@nestjsx/crud/lib/interfaces/crud-options.interface.d.ts:1:39 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

1 import { ValidationPipeOptions } from '@nestjs/common';
                                        ~~~~~~~~~~~~~~~~

../node_modules/@nestjsx/crud/lib/interfaces/serialize-options.interface.d.ts:1:22 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

1 import { Type } from '@nestjs/common';
                       ~~~~~~~~~~~~~~~~

../node_modules/@nestjsx/crud/lib/services/crud-service.abstract.d.ts:1:56 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.

1 import { BadRequestException, NotFoundException } from '@nestjs/common';
                                                         ~~~~~~~~~~~~~~~~

[2:55:32 PM] Found 22 errors. Watching for file changes.
zcharym commented 4 years ago

this might happen because of the wrong config in tsconfig.json, I changed the tsconfig.json in original one and it works.

{
  "compilerOptions": {
    "module": "commonjs",
    "declaration": true,
    "removeComments": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "allowSyntheticDefaultImports": true,
    "target": "es2017",
    "sourceMap": true,
    "outDir": "./dist",
    "baseUrl": "./",
    "incremental": true,
  }
}