Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-app new fails after install #18

Closed
bradparks opened this issue Jul 28, 2016 · 8 comments
Closed

react-app new fails after install #18

bradparks opened this issue Jul 28, 2016 · 8 comments

Comments

@bradparks
Copy link

bradparks commented Jul 28, 2016

I just installed this and tried it out and it fails automatically. What version of node can I use?

$ npm install -g react-app
/usr/local/bin/react-app -> /usr/local/lib/node_modules/react-app/bin/react-app.js
/usr/local/lib
`-- react-app@1.1.1

$ mkdir test-react-app 
$ cd test-react-app 
$ react-app new    
/usr/local/lib/node_modules/react-app/bin/react-app.js:6
const { execSync, spawn } = require('child_process');
      ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:141:18)
    at node.js:933:3
~/git/test-react-app

$ node --version
v5.7.1


@koistya
Copy link
Member

koistya commented Jul 28, 2016

@bradparks it requires Node.js >= 6. Is this OK for you? Pro tip: You can have multiple versions of Node installed on your machine via nvm.

@bradparks
Copy link
Author

cool.... i'll give that a shot... and if possible, I'd think it'd be a good idea to have your it check the node version and fail with a nice message there if the node version was too old.... thanks!

@bradparks
Copy link
Author

hey... tried it and it worked.... thanks a bunch !

@koistya
Copy link
Member

koistya commented Jul 28, 2016

@bradparks always welcome! BTW, what do you think about this config.js file which I'm planning to add into the default project template: #19

The goal of it is to provide some info, where the application should be deployed to etc. as well as to allow tweaking Webpack config in case the defaults are not good enough :)

Having this config file you will be able to publish your site by running react-app publish

@bradparks
Copy link
Author

I think the basic idea looks good... I think it does assume/suggest that people are using this to build a website, when I think just as many people would be using it to build an offline app. But having the option to both publish and 'build-for-manual-deploy` would be great of course.

@koistya
Copy link
Member

koistya commented Jul 28, 2016

@bradparks or is it better to have this in docs instead? For example:

How to Deploy

In order to deploy your web app to GitHub Pages:

  1. Create config.js file in the root of your project
  2. Export an object containing deployment: { repository: '...', branch: '...' } field

@bradparks
Copy link
Author

Ultimately if you have it as a feature, or as a doc it implies it needs to be supported in some way.

To me, a doc seems simpler, but the code does something and it's easier to verify that it works, and of course would help people do an important thing - get their site published somewhere.

So I'd say a publish option is better than a doc....

@koistya
Copy link
Member

koistya commented Aug 1, 2016

Now it should print the following message to the console, if you attempt to use this tool with Node < 6:

ERROR: This tool requires Node.js v6 or higher.

react-app v1.1.2
react-app-tools v1.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants