I prefer to install Node packages in a local directory ~/Programs/node_modules rather than using the global (-g) option which installs packages system wide which I’m not too comfortable with.

Yarn Package Manager

To initialise a repository to use yarn, do:

yarn init

Add a package with a specific version

yarn add bootstrap@3.3.7

This installs the package to node_modules.

Install packages defined in package.json

yarn install

Use a different path for installation

Warning: Deletes contents of the given directory

yarn install --modules-folder pyramid_scaffold/static/components

Arguments can be added to .yarnrc

# .yarnrc
--modules-folder pyramid_scaffold/static/components