Setting Up Your React Dev Environment Easily

“To get started, go to your src directory …”

How do I access the src directory, through terminal or otherwise?

Either way. Whatever you feel comfortable with to delete and add files. The next step also includes editing a file, so having an editor handy will help too. And if you have an editor that includes its own file management (Sublime, Code, etc.), that can also be used.

1 Like

Thanks for that.

1 Like

Literally love this article! I am actually looking into using GatsbyJS and GraphQL with Wordpress to redo my company site.

This simplified the process of creating react project environment on my local machine.

Thanks for the help!

Hi Kirupa,

First of all, thanks for the great article and I learned a lot from you. It seems that the latest serve command comes to error. I have googled it but no clue. Do you have any idea?


/usr/lib/node_modules/serve/bin/serve.js:32
const updateCheck = async isDebugging => {
^^^^^^^^^^^

SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions…js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.runMain (module.js:611:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:160:9)

Here is my setup -

Ubuntu 16.04
Node - v10.15.3
NPM - 6.4.1

The installation went fine -

vagrant@docubu:/vagrant/lab$ sudo npm install -g create-react-app
/usr/bin/create-react-app -> /usr/lib/node_modules/create-react-app/index.js
+ [email protected]
updated 1 package in 9.61s

But I am running into below error while I tried creating react app

vagrant@docubu:/vagrant/lab$ create-react-app react1
/usr/lib/node_modules/create-react-app/createReactApp.js:66
const program = new commander.Command(packageJson.name)
                ^

TypeError: commander.Command is not a constructor
    at Object.<anonymous> (/usr/lib/node_modules/create-react-app/createReactApp.js:66:17)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/usr/lib/node_modules/create-react-app/index.js:58:1)
    at Module._compile (internal/modules/cjs/loader.js:701:30)

Whats wrong here?

I saw your post a few days ago on Github as well. It is an error I have never encountered before. Not sure what is going on :frowning:

I’m having a problem. I’m receiving this response when I try to run npm install -g creat-react-app in my Mac terminal running Mojave.

Type sudo before the npm install bit. (sudo npm install -g create-react-app)

Or, after you run that command and get the error message, run sudo !!.

1 Like