In this lesson we'll show how to use yarn to alias the names of same npm libraries but install different versions. This could allow for easy migrating from one library version to an upgraded version.
You can install lib by using Yarn and give the lib an alias name:
yarn add lodash3@npm:lodash^3 // install lodash version 3yarn add lodash4@npm:lodash^4 // install lodash version 4
Then you can use it:
import lodash3 from 'lodash3';import lodash4 from 'lodash4';
Note: it only works when you and your team use Yarn, npm won't work.