In yarn v1 we initialize create react app using yarn create react-app my-app
. How to initialize the same in yan v2.
The above command gives the error
Usage Error: No project found in <<directory>>
$ yarn run <scriptName> ...
Check your yarn version:
yarn --version
If it's below 1.22 you may need to upgrade it to use yarn 2:
npm install -g yarn
You can then create your app:
yarn create react-app my-app
cd my-app
yarn set version berry
yarn
yarn start
This should have your react app up and running using yarn 2. You may want to remove the node_modules folder:
rm -R node_modules
Also, you need the next line on .yarnrc.yml
nodeLinker: "node-modules"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With