2017-08-10 10 views
0

プロジェクトでは、npmを糸で置き換えて恩恵を受けるとともに、依存関係をyarn.lockでロックするように強制しています。package.jsonとyarn.lockが同期していないときに、糸の糸の取り付けに失敗する方法を教えてください。

ここで、開発者はnpm @ 4のライブラリを追加しました。このライブラリはpackage.jsonのみを変更し、もちろんyarn.lockは変更しませんでした。

ビルドサーバーでyarn installコマンドがクラッシュすることが予想されましたが、最新のバージョンでこれらのライブラリを追加してからリモートで糸を更新すると予期しない動作が発生します。

$ yarn install 
warning ../package.json: No license field 
[1/4] Resolving packages... 
[2/4] Fetching packages... 
warning [email protected]: The platform "linux" is incompatible with this module. 
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. 
[3/4] Linking dependencies... 
[4/4] Building fresh packages... 
success Saved lockfile. 
Done in 5.07s. 

これは私が意図した目的の他に、ビルドジョブが糸をロック元に戻さないためです。

したがって、package.jsonとyarn.lockの同期が外れている場合は、yarn installをエラーコードで終了させる方法がありますか?

+0

を – k0pernikus

答えて

1

あなたは--frozen-lockfileパラメータたい:私は[糸のGitHubのレポ上の問題](https://github.com/yarnpkg/yarn/issues/4147)を開いた

$ yarn install --frozen-lockfile 
yarn install v0.27.5 
warning ../package.json: No license field 
[1/4] Resolving packages... 
error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`. 
関連する問題