Hacker News new | ask | show | jobs
by philliphaydon 2700 days ago
If a project like this uses Yarn? Is it possible to use it without Yarn?
4 comments

yes, it is posible, in practice the only difference is that some commands like build, eject, build:markdown you'll have to add the word run.

`yarn build` equals `npm run build`

`yarn eject` equals `npm run eject`

and so on ... except install, start and test which work without run.

`npm install`

`npm start`

`npm test`

There is another difference which is about the .lock file, you can delete yarn yarn.lock and keep the package-lock.json that will be generated after you run npm install.

To understand how this affect you need to understand semver and how the lock file works.

<3 thanks.
I'm pretty sure that with the newer `create-react-app` version 2, it will use Yarn in your project if you have Yarn installed globally on your system. If you do, and you want to keep it there, but use npm in your created app, then add `--use-npm` when creating your project (`npx create-react-app myAppName --use-npm`

Otherwise, if you don't have Yarn installed globally then it uses npm by default in your project.

Yes, just replace

  yarn start 
with

  npm run start
`npm start` works aswell
It’s the first thing addressed in FAQ
Ahhh i read the 'follow the tutorial' bit and then came back here to comment, I didn't see the FAQ at the bottom.