搭环境 跑的时候报错TransformError



  • error: bundling failed: "TransformError: /Users/jiyarong/webs/AwesomeProject/index.android.js: Unexpected token ) (While processing preset: \"/Users/jiyarong/webs/AwesomeProject/node_modules/babel-preset-react-native/index.js\")"
    
    

    0_1503734268319_29449439-11ae52e4-83fb-11e7-97cd-f2b3c0160b36.png
    刚开始搭环境,又碰到过这个问题的吗



  • 我科学上网查了一下,说是最新的"babel-preset-react-native"有问题,改成2.1就好了,但是我改完还是没好,求助

    {
    	"name": "AwesomeProject",
    	"version": "0.0.1",
    	"private": true,
    	"scripts": {
    		"start": "node node_modules/react-native/local-cli/cli.js start",
    		"test": "jest"
    	},
    	"dependencies": {
    		"babel-preset-react-native": "2.1.0",
    		"react": "16.0.0-alpha.12",
    		"react-native": "0.47.1"
    	},
    	"devDependencies": {
    		"babel-jest": "20.0.3",
    		"jest": "20.0.4",
    		"react-test-renderer": "16.0.0-alpha.12"
    	},
    	"jest": {
    		"preset": "react-native"
    	}
    }