react-native init 項目時報錯誤
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 (C:\WINDOWS\system32\AwesomeProject\node_modules\pirates\lib\index.js:91:24)
? ? at Module._extensions..js (module.js:654:10)
? ? at Object.newLoader [as .js] (C:\WINDOWS\system32\AwesomeProject\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)
求各位給給解決辦法
2018-07-11
親自測試了
可以使用
很感謝 哈哈
2018-07-11
我也遇到這個問題
我去試下你的方法 可以不可以!
2018-07-10
問題終于解決了,原來是前短時間更新的react-native 0.56版本在Windows上有bug不能正常運行,所以才會一直報錯,然后我試了一下
react-native init xxx --version 0.55.4