yarn import 旨在使用在 node_modules 内找到的版本根据普通的 require.resolve() 决议规则生成一个 yarn.lock 文件以缓解这一重大问题。 In cases where the Yarn resolution mechanism can’t satisfy the existing dependency tree identically, alerts will be made so that you may manually review the changes. The existing node_modules tree will be checked for validity beforehand, and the resultant lockfile should be yarn installable without any surprises (failed compatibility, unresolvable dependencies, auto-dedupes, etc.)