Share:
Notifications
Clear all

Earn While Learning Web3 Programming>> Start Here FREE!!!

[Solved] Yarn Installation and Setup For Windows and MacOS

6 Posts
2 Users
3 Reactions
743 Views
1
Topic starter

How to setup and install Yarn on Windows OS?

How to setup and install Yarn on MacOS?

EXERCISE:

i. What Is Yarn?

ii. Summarize in your own word in this forum below:

(NOTE: please, don't just copy past from other student - instead answer in your own word base on your level of understanding the lesson and resources)

 

 

 

NOTE:

This Is An Exercise From Our FREE COURSE:

 Hyperverse 201 - [DECENTOLOGY HYPERVERSE PROGRAMMING COURSE 002]

(If you have not enrolled yet, you can join the course totally for FREE).

 

2 Answers
1
Topic starter

What Is Yarn Explained:

- Yarn is a JavaScript Package Manager created by Facebook Inc. (now Meta Inc.).

 

- Similar functionality with NPM (Node Package Manager) and installs packages from NPM registry

 

- Recommended Resources:
- Yarn Crash Course: https://www.youtube.com/watch?v=g9_6KmiBISk

 

i- Install Yarn For MacOs
official Installer: https://classic.yarnpkg.com/en/docs/install
Yarn Workspace: https://classic.yarnpkg.com/en/docs/workspaces

 

 

ii- Install Yarn For Windows

Follow instruction below or here https://github.com/coreybutler/nvm-windows/wiki/Common-Issues#how-do-i-use-yarn-with-nvm-windows

- Open Powershell/Commandline

- ensure NodeJs Vs 14.18.1 is installed because it needed for this course

- "nvm list" to see list of installed Nodejs and active one

 

- Installation:

- Put in "npm install -g yarn" and ENTER

- After Installation - test if successfully install with following command
"yarn" and ENTER

if successful, it will tell you installed info like bwloe:
yarn install v1.22.17
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.21s.

 

 

iii- IMPORTANT:
When you install a package on any of the NodeJs version at global level
it may or may not migrate to another when you switch the NodeJs version with NVM

FOR EXAMPLE:

- Install Yarn as Global Package on Version 14.18.1 using
"npm install -g yarn" and ENTER

- Check the installation with
"yarn" and ENTER
you would get response like: version installed

- Then switch the NodeJS version from 14.18.1 to 14.0.0 using
"nvm use 14.0.0" and ENTER
you will likely receive error message instead showing you don't have yarn installed
which means you have to install it too on 14.0.0 because it is not been carried over
from version 14.18.1 to version 14.0.0 after we switched it with NVM.

1

Challenge:

yarn.ps1 cannot be loaded because running scripts is disabled on this system

 

solution: paste this line of code on your shell and press enter 'Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted'

 

and respond A to accept all

 

This post was modified 3 years ago by Joshua Isaac
Solomon Foskaay Solomon Foskaay Topic starter 30/11/2021 11:41 am

@joshua this is interesting and hopefully will be helpful to other student.

If I may ask

What OS where you using that gave that error?

User Avatar Joshua Isaac 30/11/2021 12:29 pm

I'm using windows 10

Solomon Foskaay Solomon Foskaay Topic starter 30/11/2021 12:37 pm

@joshua okay, it will be useful to other students using Windows.

Thank You!

Share: