47

I recently installed yarn on my machine but was using npm before. For my current project in React I want to use npm again.

However, if I run create-react-app it is built with yarn.

How can I switch so that it is created with npm?

0

2 Answers 2

99

You can use the --use-npm flag:

create-react-app my-project --use-npm
Sign up to request clarification or add additional context in comments.

Comments

35

If it's an existing project you can just remove yarn.lock and continue using it with npm.

1 Comment

Likewise, if you want to move from npm to yarn, just delete package-lock.json and use yarn

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.