Typescript fresh Nestjs应用程序上的网页包类型脚本错误
使用Typescript fresh Nestjs应用程序上的网页包类型脚本错误,typescript,webpack,nestjs,Typescript,Webpack,Nestjs,使用nest new[project name]生成新项目后,选择我的包管理器并执行warn start或npm start我的项目会抛出以下错误: $ nest start node_modules/@types/tapable/index.d.ts:7:15 - error TS2307: Cannot find module './node_modules/tapable' or its corresponding type declarations. 7 export * from '
nest new[project name]
生成新项目后,选择我的包管理器并执行warn start
或npm start
我的项目会抛出以下错误:
$ nest start
node_modules/@types/tapable/index.d.ts:7:15 - error TS2307: Cannot find module './node_modules/tapable' or its corresponding type declarations.
7 export * from './node_modules/tapable';
~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/webpack/index.d.ts:32:3 - error TS2305: Module '"tapable"' has no exported member 'Tapable'.
32 Tapable,
~~~~~~~
node_modules/@types/webpack/index.d.ts:1062:23 - error TS2707: Generic type 'SyncWaterfallHook<T, AdditionalOptions>' requires between 1 and 2 type arguments.
1062 resolver: SyncWaterfallHook;
~~~~~~~~~~~~~~~~~
node_modules/@types/webpack/index.d.ts:1063:22 - error TS2707: Generic type 'SyncWaterfallHook<T, AdditionalOptions>' requires between 1 and 2 type arguments.
1063 factory: SyncWaterfallHook;
~~~~~~~~~~~~~~~~~
node_modules/@types/webpack/index.d.ts:1064:28 - error TS2707: Generic type 'AsyncSeriesWaterfallHook<T, AdditionalOptions>' requires between 1 and 2 type arguments.
1064 beforeResolve: AsyncSeriesWaterfallHook;
~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/webpack/index.d.ts:1065:27 - error TS2707: Generic type 'AsyncSeriesWaterfallHook<T, AdditionalOptions>' requires between 1 and 2 type arguments.
1065 afterResolve: AsyncSeriesWaterfallHook;
~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/webpack/index.d.ts:1066:27 - error TS2707: Generic type 'SyncBailHook<T, R, AdditionalOptions>' requires between 2 and 3 type arguments.
1066 createModule: SyncBailHook;
~~~~~~~~~~~~
node_modules/@types/webpack/index.d.ts:1067:21 - error TS2707: Generic type 'SyncWaterfallHook<T, AdditionalOptions>' requires between 1 and 2 type arguments.
1067 module: SyncWaterfallHook;
~~~~~~~~~~~~~~~~~
node_modules/@types/webpack/index.d.ts:1068:27 - error TS2314: Generic type 'HookMap<H>' requires 1 type argument(s).
1068 createParser: HookMap;
~~~~~~~
node_modules/@types/webpack/index.d.ts:1070:30 - error TS2314: Generic type 'HookMap<H>' requires 1 type argument(s).
1070 createGenerator: HookMap;
~~~~~~~
node_modules/@types/webpack/index.d.ts:1071:24 - error TS2314: Generic type 'HookMap<H>' requires 1 type argument(s).
1071 generator: HookMap;
~~~~~~~
node_modules/@types/webpack/index.d.ts:1080:33 - error TS2314: Generic type 'HookMap<H>' requires 1 type argument(s).
1080 evaluateTypeof: HookMap;
~~~~~~~
node_modules/@types/webpack/index.d.ts:1081:27 - error TS2314: Generic type 'HookMap<H>' requires 1 type argument(s).
1081 evaluate: HookMap;
~~~~~~~
node_modules/@types/webpack/index.d.ts:1082:37 - error TS2314: Generic type 'HookMap<H>' requires 1 type argument(s).
1082 evaluateIdentifier: HookMap;
~~~~~~~
node_modules/@types/webpack/index.d.ts:1083:44 - error TS2314: Generic type 'HookMap<H>' requires 1 type argument(s).
1083 evaluateDefinedIdentifier: HookMap;
~~~~~~~
node_modules/@types/webpack/index.d.ts:1084:47 - error TS2314: Generic type 'HookMap<H>' requires 1 type argument(s).
1084 evaluateCallExpressionMember: HookMap;
~~~~~~~
node_modules/@types/webpack/index.d.ts:1085:28 - error TS2707: Generic type 'SyncBailHook<T, R, AdditionalOptions>' requires between 2 and 3 type arguments.
1085 statement: SyncBailHook;
$nest start
node_modules/@types/tapable/index.d.ts:7:15-错误TS2307:找不到模块“./node_modules/tapable”或其相应的类型声明。
7从“/node_modules/tapable”导出*;
~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/webpack/index.d.ts:32:3-错误TS2305:模块“tapable”没有导出的成员“tapable”。
32可点击,
~~~~~~~
node_modules/@types/webpack/index.d.ts:1062:23-错误TS2707:泛型类型“syncwaterwallhook”需要1到2个类型参数。
1062分解器:syncwaterwallhook;
~~~~~~~~~~~~~~~~~
node_modules/@types/webpack/index.d.ts:1063:22-错误TS2707:泛型类型“syncwaterwallhook”需要1到2个类型参数。
1063工厂:SyncwaterWallHook;
~~~~~~~~~~~~~~~~~
node_modules/@types/webpack/index.d.ts:1064:28-错误TS2707:泛型类型“AsyncSeriesWaterWallHook”需要1到2个类型参数。
1064 beforeResolve:AsyncSeriesWaterWallHook;
~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/webpack/index.d.ts:1065:27-错误TS2707:泛型类型“AsyncSeriesWaterWallHook”需要1到2个类型参数。
1065 afterResolve:AsyncSeriesWaterWallHook;
~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/webpack/index.d.ts:1066:27-错误TS2707:泛型类型“SyncBailHook”需要2到3个类型参数。
1066 createModule:SyncBailHook;
~~~~~~~~~~~~
node_modules/@types/webpack/index.d.ts:1067:21-错误TS2707:泛型类型“syncwaterwallhook”需要1到2个类型参数。
1067模块:syncwaterwallhook;
~~~~~~~~~~~~~~~~~
node_modules/@types/webpack/index.d.ts:1068:27-错误TS2314:泛型类型“HookMap”需要1个类型参数。
1068 createParser:HookMap;
~~~~~~~
node_modules/@types/webpack/index.d.ts:1070:30-错误TS2314:泛型类型“HookMap”需要1个类型参数。
1070 createGenerator:HookMap;
~~~~~~~
node_modules/@types/webpack/index.d.ts:1071:24-错误TS2314:泛型类型“HookMap”需要1个类型参数。
1071生成器:HookMap;
~~~~~~~
node_modules/@types/webpack/index.d.ts:1080:33-错误TS2314:泛型类型“HookMap”需要1个类型参数。
1080 evaluateTypeof:HookMap;
~~~~~~~
node_modules/@types/webpack/index.d.ts:1081:27-错误TS2314:泛型类型“HookMap”需要1个类型参数。
1081评估:钩图;
~~~~~~~
node_modules/@types/webpack/index.d.ts:1082:37-错误TS2314:泛型类型“HookMap”需要1个类型参数。
1082 evaluateIdentifier:HookMap;
~~~~~~~
node_modules/@types/webpack/index.d.ts:1083:44-错误TS2314:泛型类型“HookMap”需要1个类型参数。
1083 EvaluatedDefinedIdentifier:HookMap;
~~~~~~~
node_modules/@types/webpack/index.d.ts:1084:47-错误TS2314:泛型类型“HookMap”需要1个类型参数。
1084 evaluateCallExpressionMember:HookMap;
~~~~~~~
node_modules/@types/webpack/index.d.ts:1085:28-错误TS2707:泛型类型“SyncBailHook”需要2到3个类型参数。
1085语句:SyncBailHook;
我已经尝试过重新安装nest cli,在npm和Thread之间切换,删除dist文件夹和node_modules文件夹(并安装依赖项)您可以在
编译器选项下的tsconfig.json中使用skipLibCheck:true
忽略这一点
编辑
看起来他们升级Nest的CLI并重新安装模块应该可以解决这个问题
npm安装-g@nestjs/cli@latest
rm-rf节点模块
rm package lock.json
npm安装