node.js - npm run build 在构建 react-native 模块(react-native-stars)时给出 Ionic React 的语法错误
问题描述
我收到以下错误:
> react-scripts build
> Creating an optimized production build...
> Failed to compile.
> ./node_modules/react-native-stars/index.js
> SyntaxError:
> /mnt/c/linux_share/ayelho-mockup/node_modules/react-native-stars/index.js:
> Unexpected token (35:8)
> 33 | return this.props.opacity ?
> 34 | this.isReactElement(this.props.fullStar) ?
> > 35 | <View style={{opacity: partial}}>
> > | ^
> 36 | {this.props.fullStar}
> 37 | </View>
> 38 | :
我试过使用 react-native-star-rating 并且这给出了类似的错误(它失败了)。所以这可能是我的设置中的东西。我需要做些什么来告诉它这是一个标签吗?
主应用程序是用打字稿编写的。
解决方案
推荐阅读
- javascript - 转换旋转的 Firefox 抽搐问题
- angular - Angular 6 Reactive Form添加错误类容器Div
- c# - trigger style 改变一个元素的所有样式
- c# - SQL查询使用C#返回太多相同的列数据
- html - Boostrap 背景在 CSS 中不起作用,位置:固定也不起作用
- mysql - 两个单独的查询瞬时。用子查询查询很慢。为什么?mysql/mariadb
- laravel - Laravel 从关系中只得到一列
- php - 如何使用 GitLab API 获取合并分支的列表?
- javascript - 切换选项卡时未触发 setOnNavigatorEvent 回调
- memory - Discord 如何从游戏中读取内存?