diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index e10bd410fe13..59c3d9ffc968 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -98,6 +98,14 @@ Node.js comes with npm, which lets you install the React Native command line int npm install -g react-native-cli ``` +Ensure your version of npm is greater than 3: +``` +npm --version +``` +If it is not you can update npm: +``` +npm install npm@latest -g +``` > If you get a *permission error*, try using sudo: `sudo npm install -g react-native-cli`. > If you get an error like `Cannot find module 'npmlog'`, try installing npm directly: `curl -0 -L http://npmjs.org/install.sh | sudo sh`. diff --git a/local-cli/__tests__/generators-test.js b/local-cli/__tests__/generators-test.js index f36fa7021257..0070ec721d41 100644 --- a/local-cli/__tests__/generators-test.js +++ b/local-cli/__tests__/generators-test.js @@ -52,6 +52,7 @@ xdescribe('React Yeoman Generators', function() { '.flowconfig', '.gitignore', '.watchmanconfig', + '.babelrc', 'index.ios.js', 'index.android.js' ]); diff --git a/local-cli/generator/index.js b/local-cli/generator/index.js index 10295b68aabe..0bf880f04863 100644 --- a/local-cli/generator/index.js +++ b/local-cli/generator/index.js @@ -73,6 +73,10 @@ module.exports = yeoman.generators.NamedBase.extend({ this.templatePath('_buckconfig'), this.destinationPath('.buckconfig') ); + this.fs.copy( + this.templatePath('_babelrc'), + this.destinationPath('.babelrc') + ); }, writing: function() { diff --git a/local-cli/generator/templates/_babelrc b/local-cli/generator/templates/_babelrc new file mode 100644 index 000000000000..a9ce1369e617 --- /dev/null +++ b/local-cli/generator/templates/_babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["react-native"] +}