How to use yarn's portal protocol?

51 Views Asked by At

The problem

When I use the portal protocol of yarn to add my local package it just gets installed from the npm registry instead.

I want to develop said package so I need to be working with the latest code not the one published to the registry.

What I tried

I tried using yarn add vexflow-repl@portal:../../vexflow-repl by following the example provided by yarn's official website.

Before I run the above command my dependencies look like this:

dependencies before

After I run the command they look like this:

dependencies after

Nothing else changed in my package.json and the package is installed from the npm registry instead of my local folder.

Observations

If I instead use yarn add file:..\..\vexflow-repl the package does get installed from my local folder and my dependencies look like this:

dependencies after adding with file protocol

With yarn's file protocol I can work as I intended with the latest code from my package at the expense of duplicate files and some overhead.

System information

I use windows.

0

There are 0 best solutions below