Non-string value passed to `ts.resolveTypeReferenceDirective`解决方法

问题

  • 安装运行时出现:
 ts.Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.");

解决方式

  • 固定typescript版本号4.6.x,添加resolutions
 "resolutions": {
    "typescript": "4.6.4"
  },
  • 然后重新安装yarn install --force,此时问题应该已解决,如果没解决,你可能装了ts-node,固定ts-node版本:
"ts-node": "10.8.1"

猜你喜欢

转载自blog.csdn.net/yehuozhili/article/details/128775134