[问题解决] import type {CommandT} from './commands‘问题

为什么80%的码农都做不了架构师?>>>   hot3.png

 就在几天前,react更新0.56.0版本,window上出现BUG,具体如下:

F:\AAAA\node_modules\react-native\local-cli\cliEntry.js:30
import type {CommandT} from './commands';
       ^^^^

SyntaxError: Unexpected identifier
    at new Script (vm.js:74:7)
    at createScript (vm.js:246:10)
    at Object.runInThisContext (vm.js:298:10)
    at Module._compile (internal/modules/cjs/loader.js:670:28)
    at Module._compile (F:\AAAA\node_modules\pirates\lib\index.js:91:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:713:10)
    at Object.newLoader [as .js] (F:\AAAA\node_modules\pirates\lib\index.js:96:7)
    at Module.load (internal/modules/cjs/loader.js:612:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
    at Function.Module._load (internal/modules/cjs/loader.js:543:3)

解决方案:

react-native init MyApp --version 0.55.4

显示结果:

Done in 13.28s.
To run your app on iOS:
   cd F:\MyApp
   react-native run-ios
   - or -
   Open ios\MyApp.xcodeproj in Xcode
   Hit the Run button
To run your app on Android:
   cd F:\MyApp
   Have an Android emulator running (quickest way to get started), or a device connected
   react-native run-android

 

 

 

 

转载于:https://my.oschina.net/gain/blog/1841364

你可能感兴趣的:([问题解决] import type {CommandT} from './commands‘问题)