Is there a proper way to install local plugin's dependencies?

There is a feature called “Workspaces”, which helps you to setup multiple packages in such a way that you only need to run yarn install once to install all of them in a single pass.
To achieve this start using yarn instead of npm. As npm released workspaces just a few weeks ago for v7 (which is available with Node v15).

Add workspaces to the package.json, In your case your local plugins that are under development. Please note that "private": true property is mandatory when working with workspaces.

//...
  "private": true,
  "workspaces": [
    "plugins/*"
  ],
//...

Now run yarn install, it will install all your packages from ./plugins/{plugin-name}/package.json. Also it will create a symlink for your plugin inside the node_modules:
image

Please note that after this Yarn will not allow you to add packages into the root packages.json, as it is expecting you to add them to Workspaces. To add a package to root packages.json please add the -W flag:

yarn add axios -W

7 Likes