|
Installing Yarn
In this tutorial, we will show you how to install the Yarn package manager on your account using the WebApps platform.
If you do not see a WebApps section in the Control Panel of your hosting account, this tutorial may not be suitable for your particular hosting environment. Please contact our support team for more information.
- You need to connect to your account via SSH.
- Create the directory where you wish to install Yarn (e.g. "~/private/yarn"), and enter that directory. You can use the following SSH command to achieve this:
mkdir /home/$USER/private/yarn && cd /home/$USER/private/yarn
- Create a web application for Yarn using the sureapp CLI tool:
sureapp project create \ --engine node \ --engine-version lts \ --release-dir "/home/$USER/private/yarn" \ yarn This will create a new web application named "yarn", whose files will be stored in the "/home/$USER/private/yarn" directory.
- Access the "yarn" web application:
sureapp project shell yarn
- Install Yarn globally for the web application:
npm install -g yarn
Congratulations! You can now use "yarn" within your project's shell. You could navigate to a directory and run a command to start a new project:
yarn init
You can also add a dependency to your project. To add the a package (e.g. "lodash"), you can use this command:
yarn add lodash
|
|