How to install npm packages from your local machine

If you need to manually test a package you are developing and don't want to make a release each time you modify something, you can install it directly from your local machine.

You can achieve this  by using the following commands, depending on the package manager you use:

```bash
yarn add [path-to-your-package]
```
```bash
npm install [path-to-your-package]
```

This will have the following equivalent in package.json:

```json
...
"dependencies": {
    "[package]": "file:[relative-path-to-package]",
    ...
},
```

Denisa Halmaghi
02 Sep 2022
« Back to post