i just created my react app by installing the create-react-app . But i have a issue where if we work on the propTypes it throws an error saying that āPropTypesā is not defined. (no-undef). you can view the issue here https://stackoverflow.com/questions/45692537/proptypes-is-not-defined .
It looks like the solution for this is to use the eslint 3.* where create-react-app uses the latest eslint 4.* - Do you know how to downgrade the verison to eslint 3.* - If so can you post the steps .
Hello Kirupa, unfortunately I am going to add to the create-react-app installation questions.
I am using Windows 10 with npm 5.5.1 and node 8.9.1.
create-react-app installs successfully, but when I try to create a project I get one of these errors:
ācreate-react-appā is not recognized as an internal or external command,
operable program or batch file
bash: create-react-app: command not found
Iāve tried with the windows and node command prompts and gone through several suggestions from stack overflow and the github create-react-app page. Iāve made several changes to my Environment variables as suggested, but so far no luck. Just thought Iād try one more forum. Thank you.
Thanks for the reply, Kirupa.
I did try those articles before, and I tried those steps again today with the node and windows command prompts and even Power Shell as an admin, but Iām still not able to create a new create-react app.
Specifically, this is what I did:
Added /usr/local/bin/ to my user and system variables in the Environmental Variables dialogue.
I also tried:
$ npm config set prefix /usr/local
$ npm install -g create-react-app
$ create-react-app my-app
create-react-app, gulp, and yarn get installed to this folder: C:\usr\local
But after running the gulp, yarn, or create-react-app commands, I end up with errors like:
ācreate-react-appā is not recognized as an internal or external command,
operable program or batch file.
Any other thoughts? If not, Iāll just have to try on a different computer. Thank you.
That didnāt work for my desktop Window computer either, so I tried on a Window 10 laptop that didnāt have that much software on it yet, and the create-react-app installation worked.
btw, Iāve found your book and tutorials easier to follow than some of the other React ones out there, so thanks for the help and work you do.
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.
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?
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)
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)