如何解决语法错误,意外令牌,导出类型?

问题描述 投票:1回答:1

我使用的是2.xreact-navigation版本,现在我要迁移到5.x的版本。我已经根据文档安装了所有模块,但是在运行该应用程序时,出现此错误。

它似乎更像是一个打字稿编译错误,但我不确定为什么会出现,因为我只运行了npm install命令,却没有碰到任何node_module文件。

error: SyntaxError: E:\PROJECTS\rnzone\BoxApp\node_modules\@react-navigation\stack\src\index.tsx: Unexpected token (51:12)

  49 |  * Types
  50 |  */
> 51 | export type {
     |             ^
  52 |   StackNavigationOptions,
  53 |   StackNavigationProp,
  54 |   StackHeaderProps,

你有什么建议?

node.js typescript react-native react-navigation node-modules
1个回答
0
投票

因此,我能够通过在开发依赖项中升级@babel/core@babel/runtime来解决此问题。

在7.9.0中添加了对仅类型导入+导出的支持

感谢nickyleach指出了this

© www.soinside.com 2019 - 2024. All rights reserved.