yarn で npmrc に書いた save exact が効かない

.npmrc'save-exact': true を設定してるのに、 yarn でnpmモジュールをインストールすると、 ^ 付きでインストールされてしまう。

結論としては ~/.yarnrcsave-prefix false を追加すればよい。

少し前までは、 yarn config set save-prefix '' を実行してyarnの設定を更新する必要があったが、これも不要になった模様。 ちなみに設定を確認するには、 yarn config list を実行すれば確認できる。

❯ yarn config list
yarn config v0.27.5
info yarn config
{ 'version-tag-prefix': 'v',
  'version-git-tag': true,
  'version-git-sign': false,
  'version-git-message': 'v%s',
  'init-version': '1.0.0',
  'init-license': 'MIT',
  'save-prefix': false,
  'ignore-scripts': false,
  'ignore-optional': false,
  registry: 'https://registry.yarnpkg.com',
  'strict-ssl': true,
  'user-agent': 'yarn/0.27.5 npm/? node/v8.3.0 darwin x64',
  lastUpdateCheck: 1502693249675 }
info npm config
{ save: true,
  'save-exact': true,
  progress: false}
Done in 0.07s.

References