跑不起来,报错
i-am-zhengyufang opened this issue · 9 comments
报错1:Interface 'NodeRequire' cannot simultaneously extend types 'RequireFunction' and 'Require'. Named property 'resolve' of types 'RequireFunction' and 'Require' are not identical
报错2:Subsequent variable declarations must have the same type. Variable 'URL' must be of type '{ new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }', but here has type '{} | typeof URL'.
还有很多报错,暂时列出了这几个,网上找了很久也没找到答案
有可能是 npm install
后依赖包的版本问题,对比看下 package-lock.json
中对应的版本。
报错1:Interface 'NodeRequire' cannot simultaneously extend types 'RequireFunction' and 'Require'. Named property 'resolve' of types 'RequireFunction' and 'Require' are not identical 报错2:Subsequent variable declarations must have the same type. Variable 'URL' must be of type '{ new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }', but here has type '{} | typeof URL'. 还有很多报错,暂时列出了这几个,网上找了很久也没找到答案
请问您解决了吗?
React typescript 包相关的版本,你安装的可能不是 package.json 里面的版本,不兼容就报错了
@rxl123 服务端api运行起来了吗
服务端api咋运行。哥
@rxl123 服务端api运行起来了吗
跑起来了,牛逼啊 哥