使用此配置:
OX S 10.11.3
npm 3.5.2
节点5.1.0
Xcode 7.2.1
React Native 0.1.10
我有以下错误:
407/408Error while persisting cache: TransformError: /Users/apple/Desktop/HelloReactNative/node_modules/react-deep-force-update/lib/index.js: [BABEL] /Users/apple/Desktop/HelloReactNative/node_modules/react-deep-force-update/lib/index.js: Unknown option: /Users/apple/Desktop/HelloReactNative/node_modules/react-deep-force-update/.babelrc.stage
答案 0 :(得分:0)
尝试使用以下内容将.babelrc文件添加到项目中:
{
"retainLines": true,
"compact": true,
"comments": false,
"plugins": [],
"presets": ["stage-0", "react", "react-native"],
"sourceMaps": false,
}
并使用npm i --save-dev <pacakge-name>
和以下开发依赖项安装dev-dependencies:
"devDependencies": {
"babel-preset-react": "^6.3.13",
"babel-preset-react-native": "^1.4.0",
"babel-preset-stage-0": "^6.3.13"
}
修改强>
按照@ S.Yeah提供的链接,看起来错误来自react-deep-force-update
包中的.babelrc文件。删除该文件应该可以解决问题:
cd node_modules/react-deep-force-update && rm -rf .babelrc