简体   繁体   English

在WebStorm中运行React-native项目时出错

[英]Error running React-native project in WebStorm

This project I can run fine in command line, but if I run it using WebStorm, there will be an error like the following image: 我可以在命令行中很好地运行该项目,但是如果使用WebStorm运行它,将出现如下图所示的错误:

错误图片

I guess your webstorm is still using ecmascript 5.1 for javascript which does not support import keyword that is why ur getting this error. 我想您的网络风暴仍在使用ecmascript 5.1 for javascript,它不支持import关键字,这就是您收到此错误的原因。 U can fix it by going to preferences(on mac) and file->settings->language and frameworks->javascript change javascript language version from ecma5.1 to ecma6 or react jsx 您可以通过以下方法修复该问题:转到偏好设置(在Mac上),然后转到文件->设置->语言和框架-> javascript将javascript语言版本从ecma5.1更改为ecma6或对jsx进行反应

I didn't set run/debug configurations. 我没有设置运行/调试配置。 I run a react-native project as a node js. 我运行一个本机项目作为节点js。 It run successfully when I set the configuration. 设置配置后,它可以成功运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM