首页 > 解决方案 > 获取错误 @types/tapable/index"' 不是构造函数类型

问题描述

我的生产网站运行良好。但是在服务器上放置“npm install”命令然后尝试使用“npm run build:prod”命令进行构建。面临以下错误。

ERROR in [at-loader] node_modules/@types/tapable/index.d.ts:290:30 
    TS2314: Generic type 'HookMapInterceptor<T1, any, T2, T3>' requires 4 type argument(s).

ERROR in [at-loader] node_modules/@types/tapable/index.d.ts:293:38 
    TS2368: Type parameter name cannot be 'any'

ERROR in [at-loader] node_modules/@types/tapable/index.d.ts:293:48 
    TS2300: Duplicate identifier 'any'.

我试过这个命令“npm install @types/tapable@1.0.2”。但没有解决问题。请帮帮我。

标签: angularnpm

解决方案


这可能与这个问题有关:

https://github.com/webpack/tapable/issues/53

尝试npm install @types/tapable@0.2.5


推荐阅读