一旦運行react-native init testNative
反應本土的init:的ReferenceError:BABEL]未知選項:未知選項:base.optional
ReferenceError: [BABEL] /Users/m/git/testNative/node_modules/react-native/local-cli/bundle/bundle.js: Unknown option: base.optional
at Logger.error (/Users/m/git/testNative/node_modules/babel-core/lib/transformation/file/logger.js:41:11)
at OptionManager.mergeOptions (/Users/m/git/testNative/node_modules/babel-core/lib/transformation/file/options/option-manager.js:289:18)
at OptionManager.init (/Users/m/git/testNative/node_modules/babel-core/lib/transformation/file/options/option-manager.js:486:10)
at File.initOptions (/Users/m/git/testNative/node_modules/babel-core/lib/transformation/file/index.js:211:75)
at new File (/Users/m/git/testNative/node_modules/babel-core/lib/transformation/file/index.js:129:22)
at Pipeline.transform (/Users/m/git/testNative/node_modules/babel-core/lib/transformation/pipeline.js:48:16)
at Object.transformFileSync (/Users/m/git/testNative/node_modules/babel-core/lib/api/node.js:118:10)
at compile (/Users/m/git/testNative/node_modules/babel-register/lib/node.js:100:20)
at loader (/Users/m/git/testNative/node_modules/babel-register/lib/node.js:128:14)
at Object.require.extensions.(anonymous function) [as .js] (/Users/m/git/testNative/node_modules/babel-register/lib/node.js:138:7)
我試過在以下職位的建議,我發現了以下錯誤(https://github.com/facebook/react-native/issues/5 ,https://github.com/babel/babel-loader/issues/132,https://github.com/babel/babelify/issues/129,React 0.14 error: Module build failed: ReferenceError: [BABEL] .../node_modules/eslint-loader/index.js!/.../main.jsx: Unknown option: base.stage),但無濟於事。
我目前的假設是因爲我的系統上沒有任何地方的.babelrc文件,所以它會回落到「base.optional」。至少將一個.babelrc文件添加到我的項目文件夾是唯一產生不同結果的東西(降級節點,babel或react-native什麼也不做)。所以,如果這是解決方案,有沒有人知道我的.babelrc文件應該包括一個react-native項目?
感謝
非常感謝你,這就像一個魅力! – jaxoncreed