0

I want to use https://www.npmjs.com/package/boardgame.io but want to have it as local dependency to be able to debug, modify etc. So i cloned repo and in my app package.json i have "boardgame.io": "file:~/Projects/Games/boardgame.io", So far so good, but problem is that package makes use of exportAliases when i try for example import { Client } from "boardgame.io/react"; i get Unable to resolve. It works just fine when i use npm published version of boardgame, so it leads me to suspicion that there is some trick i dont know to make such packages working locally (boardgame.io is just example, with other packages problem is the same). Do you have any idea how to solve this?

chilly_maximus
  • 623
  • 7
  • 15
  • Did you built the package? – doniyor2109 Nov 18 '18 at 11:07
  • Does this answer your question? [how to specify local modules as npm package dependencies](https://stackoverflow.com/questions/15806241/how-to-specify-local-modules-as-npm-package-dependencies) – Inigo May 22 '20 at 17:13

1 Answers1

4

I think you are looking for the npm link command.

Example:

cd ~/projects/package-to-link  // go into the package directory
npm link                       // creates global link
cd ~/projects/your-project     // go into some other package directory.
npm link package-to-link       // link-install the package
lependu
  • 1,160
  • 8
  • 18