Each created Node.js application server within CirrusGrid PaaS is provisioned with out-of-box support of two main package managers for this language – Yarn and npm. Both of them operates the same npm registry with a broad collection of the dedicated software packages, providing standardization and automation of the installation, update, configuration and removal processes.
By default, the npm package manager will be used for archive or Git deployment operations through CirrusGrid dashboard, but it can be easily switched to the yarn one in case of necessity. For that, access the corresponding Docker container settings frame and set the appropriate PACKAGE_MANAGER Docker container variable to either npm or yarn value.
Below, we’ve gathered some basics on operating these managers, intended to help you on determining which one suits you best:
Node Package Manager (npm) can be used for managing additional modules and packages, required for your project, as well as for installation of the ready-to-use applications.
There are two ways to install necessary Node.js packages with npm:
1. Specify required ones within the dependencies section of the NodeJS package.json file, located in the root directory of your project. Such packages will be automatically downloaded and installed by npm during application server startup. Herewith, the new modules specified in the package.json file will be added after NodeJS node restart.
2. Connect to the container via SSH Gate and operate your packages manually with the following commands:
Yarn is a recently released package manager, which is already highly popular due to its speed, reliability and convenience. Yarn operates the same NodeJS package.json file as in npm, so no changes are required for the existing applications.
You can use the following list of commands to work with Yarn, while connected over SSH:
Powered by BetterDocs
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.