Skip to the content
Programming & tools

How do I install a library or package into my coding project?

You'll be able to: Install npm packages and add project dependencies from the terminal

Risk
Safe to try
Windows
Windows 11 · Windows 10

Filed under Programming & tools

The steps

  1. 1

    Open your project folder in VS Code and press Ctrl~ to open the integrated terminal. The terminal pane opens at the bottom of VS Code showing your project directory path.

    What is a package manager?

    Package managers (like npm or bun) let you download and reuse pre-written, open-source code libraries without writing everything from scratch.

  2. 2

    Type npm install package_name (replace package_name with the actual library name, like lodash or zod) and press Enter. The terminal downloads the package files and prints a completion summary with added package count.

    VS Code integrated terminal displaying npm install command and successful package addition output.
  3. 3

    Look at the file explorer sidebar on the left side of your editor. The library name appears under dependencies inside your package.json file, and downloaded files reside safely in the node_modules folder.

  4. It looks different on my screen

    If you are using Bun instead of Node/npm, type bun add package_name for ultra-fast package installations.

Did this work?

Updated 2026-08-29اقرأ بالعربية