What is Package Manager
A package manager is a piece of software that lets you manage
the external code, written by you or someone else, that your
project needs to work correctly. By default, NativeScript CLI
uses Node Package Manager (npm) for managing the
dependencies of the application. When new application is
created, CLI automatically calls npm install to
install all of its dependencies.
Supported package managers
NativeScript CLI allows you to configure the package manager
used when working with dependencies. When you change the
defaultly used npm package manager, CLI will use
the newly set package manager for all operations it executes
related to project dependencies, for example, project creation,
managing dependencies, etc.
NativeScript CLI supports three package managers:
npm- this is the default option-
yarn- you can set it by callingtns package-manager set yarn. More information aboutyarnis available here -
pnpm- from version 6.4, you can usepnpmto manage the dependencies of your application. You can usepnpmby callingtns package-manager set pnpm. NOTE: You will have to use--shamefully-hoistflag if you callpnpmon your own. CLI passes this flag when installing dependencies withpnpmand probably your application will not work if you omit it. More information aboutpnpmis available here.
In case you want to check what is the currently used package manager, you can use:
$ tns package-manager get