相关疑难解决方法(0)

创建新的react-native项目时出现"意外的令牌导入"错误

我使用以下方法创建一个新的react-native项目:

react-native init {proj_name}
Run Code Online (Sandbox Code Playgroud)

但是我收到以下错误.

D:\Reactnative\Project\{proj_name}\node_modules\react-native\local-cli\cliEntry.js:30
import type {CommandT} from './commands';
^^^^^^

SyntaxError: Unexpected token import
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:607:28)
    at Module._compile (D:\Reactnative\Project\Learnwizz\node_modules\pirates\lib\index.js:91:24)
    at Module._extensions..js (module.js:654:10)
    at Object.newLoader [as .js] (D:\Reactnative\Project\Learnwizz\node_modules\pirates\lib\index.js:96:7)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Module.require (module.js:587:17)
Run Code Online (Sandbox Code Playgroud)

react-native

19
推荐指数
1
解决办法
4476
查看次数

标签 统计

react-native ×1