node.js - React Native Transform Error -


previously had react-native running nicely, don't recall changing anything, error has proved impossible clear.

environment windows 10 react-native-cli: 2.0.1 react-native: 0.47.1 node v6.11.2

fresh install of node.js after uninstalling previous versions , removing node , npm directories paths. fresh install of react-native per https://facebook.github.io/react-native/docs/getting-started.html

react-native init awesomeproject cd awesomeproject react-native run-android

also tried

npm -g react-native-git-upgrade

react-native-git-upgrade

reboot, new project, uninstall node, reinstall node, reinstall react-native, new project.

still same problem.

repeated react-native-git-upgrade v0.47.0 wondering if should try downgrading earlier version. weird thing working 2 days ago on react-native version downloaded , installed 8-9 days ago.

repeatedly getting same error below. lost time on this. hurts.

the development server returned response error code: 500

url: http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false

body: {"message":"transformerror: d:\blah\awesomeproject\index.android.js: unexpected token ) (while processing preset: \"d:\\blah\\awesomeproject\\node_modules\\babel-preset-react-native\\index.js\")","type":"transformerror","linenumber":0,"description":"","errors":[{"description":"","linenumber":0}]} processbundleresult bundledownloader.java:170 access$100 bundledownloader.java:39 onresponse bundledownloader.java:139 execute realcall.java:135 run namedrunnable.java:32 runworker threadpoolexecutor.java:1133 run threadpoolexecutor.java:607 run thread.java:761

this doesn't depend node, there's no point in uninstalling it. what's causing trouble 'react-native init' automatically tried fetch wrong version of package handles react's babel transform.

to solve it, force usage of correct version:

if use yarn:

yarn remove babel-preset-react-native yarn add babel-preset-react-native@2.1.0 --dev 

if use npm:

npm un -d babel-preset-react-native npm -d babel-preset-react-native@2.1.0 

i hope useful.


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -