Dependencies with NPM and Yarn
Norce Flight projects use Yarn (a NPM client) for dependency management.
The package.json
file in the root of your project lists the names and required
versions of all your project dependencies. Packages with names that start
with @jetshop/
are part of the Flight Framework. They can be installed,
upgraded and managed the same way as any other NPM package.
Should I Use npm
or yarn
?
Always use yarn
and yarn add
when you are working on a Flight project.
The installation instructions for third party packages some times only include
a npm install
command. It's safe to substitute that with yarn add
instead.
Whats this yarn.lock
file?
Yarn automatically keeps track of the exact versions of all packages you install
in the yarn.lock
file at the root of your project. This file is then used to
guarantee you get the exact same packages next time you (or someone else)
set up your project.
This is important as it helps eliminate otherwise hard to debug errors that might occur when you end up with different package versions in production and on your local development machine.
Further Reading
Please refer to the excellent NPM and Yarn docs for further information.