Yes, there is, using yarn link. Yarn link allows you to create symlinks to local projects.
Go to the folder libB and run:
yarn link
Then go to the folder libA and run:
yarn link libB
NOTE: that libB must be the name on the package.json inside the libB folder
Then you can require your libB code as usual:
const libB = require('libB')