Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


Anaet Hossain
Anaet Hossain
13,153 Points

Yarn instead of NPM

Can i use YARN instead of NPM?

1 Answer

28,558 Points

You don't specify what course you are referencing, but in general the answer to that question is yes. Yarn is designed to be a drop-in replacement for npm.

Some of its syntax and behavior is slightly different, but it generates a package.json file that is npm compatible, and it can also read npm package.json files without issue.

I have personally moved to yarn for all of my projects, though I still use npm to install global packages since that has been buggy for me with Yarn on Windows.