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 aboutyarn
is available here -
pnpm
- from version 6.4, you can usepnpm
to manage the dependencies of your application. You can usepnpm
by callingtns package-manager set pnpm
. NOTE: You will have to use--shamefully-hoist
flag if you callpnpm
on your own. CLI passes this flag when installing dependencies withpnpm
and probably your application will not work if you omit it. More information aboutpnpm
is available here.
In case you want to check what is the currently used package manager, you can use:
$ tns package-manager get