sometime we may neednt to install all package by lerna. But we will found when we build wallex-base, wallex-web wont work. Thats beacuse lerna link local wallex-base to wallex-web. but we install by npm is actually wallex-base in remote.
you can use
npm link to create link
/Users/wenjiejin/.nvm/versions/node/v12.18.3/lib/node_modules/@wallex/base -> /Users/wenjiejin/wallex-dev/packages/wallex-base
you will see in the nvm @wallex/base is already link to local files.
then lets go to wallex-web and run:
npm link @wallex/base.
/Users/wenjiejin/wallex-dev/packages/wallex-web/node_modules/@wallex/base -> /Users/wenjiejin/.nvm/versions/node/v12.18.3/lib/node_modules/@wallex/base -> /Users/wenjiejin/wallex-dev/packages/wallex-base
now wallex-web will use local wallex-base codes to run
since its global link (in nvm)
you may need to unlink it when more wallex-base need to link
npm unlink @wallex/base
However, lerna link scope is not global (actually it dosent use npm link). Its just for one project. We can find out how lerna do it so elegent by reading its core code
which use fs.symlink to do it.
we can also write a simple script to do it!