Reputation: 91949
I am following https://hackernoon.com/simple-react-development-in-2017-113bd563691f
I am new to React
ecosystem and I just now installed Yarn
ā WebstormProjects yarn --version
0.23.2
Then I installed created-react-app
as mentioned in the docs as
ā WebstormProjects yarn global add create-react-app
yarn global v0.23.2
warning No license field
[1/4] š Resolving packages...
[2/4] š Fetching packages...
[3/4] š Linking dependencies...
[4/4] š Building fresh packages...
success Installed "[email protected]" with binaries:
- create-react-app
warning No license field
āØ Done in 0.82s.
Then, I tried creating app
ā WebstormProjects create-react-app myproject
zsh: command not found: create-react-app
Then, I headed over https://github.com/facebookincubator/create-react-app and tried installing using npm
as
ā WebstormProjects npm install -g create-react-app
npm ERR! addLocal Could not install /Users/Harit.Himanshu/WebstormProjects/create-react-app
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/7.9.0/bin/node" "/usr/local/bin/npm" "install" "-g" "create-react-app"
npm ERR! node v7.9.0
npm ERR! npm v4.2.0
npm ERR! No name provided in package.json
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Harit.Himanshu/.npm/_logs/2017-04-15T03_06_22_478Z-debug.log
The node
and npm
versions I have are
ā WebstormProjects node --version
v7.9.0
ā WebstormProjects npm --version
4.2.0
ā WebstormProjects
What mistake I am making?
Upvotes: 1
Views: 3371
Reputation: 41
cd ~
npm cache clean --force
npm install -g npm@latest --force
npm cache clean --force
npx create-react-app my-app
Upvotes: 1
Reputation: 10512
Based on npm
's output, it's interpreting your command as an attempt to install a package contained in a local directory globally. You might want to try rm -rf create-react-app && sudo npm i -g create-react-app
within that same directory.
Upvotes: 2