Yarn: Yarnは、プラットフォーム固有のオプションの依存関係をインストールすることを主張します

作成日 2017年01月12日  ·  3コメント  ·  ソース: yarnpkg/yarn

機能をリクエストしバグを報告しますか?

バグ。

現在の動作は何ですか?

Windows固有のオプションの依存関係を含むetcher-image-writeモジュールを追加しようとしています。

  ...
  "optionalDependencies": {
    "diskpart": "^1.0.0"
  },
  ...

diskpartモジュールは、そのpackage.jsonで、Windowsにのみインストールできることを宣言しています。

  ..
  "os": [
    "win32"
  ],
  ..

ただし、 etcher-image-writeを追加しようとすると、次の出力が得られます。

$ yarn add etcher-image-write
yarn add v0.19.0
info No lockfile found.
warning npm-shrinkwrap.json found. This will not be updated or respected. See https://yarnpkg.com/en/docs/migrating-from-npm for more information.
[1/4] 🔍  Resolving packages...
warning [email protected]: this package is no longer updated or maintained
warning [email protected]: electron-prebuilt has been renamed to electron. For more details, see http://electron.atom.io/blog/2016/08/16/npm-install-electron
warning file-tail > [email protected]: this package is no longer updated or maintained
warning electron-builder > progress-stream > through2 > xtend > [email protected]:
warning electron-packager > asar > mksnapshot > request > [email protected]: use uuid module instead
[2/4] 🚚  Fetching packages...
warning [email protected]: The platform "darwin" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
warning [email protected]: The platform "darwin" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
error [email protected]: The platform "darwin" is incompatible with this module.
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

現在の動作がバグである場合は、再現する手順を提供してください。

yarn add etcher-image-write

期待される動作は何ですか?

diskpartetcher-image-writeオプションの依存関係であるため、プラットフォームの不一致がある場合でもYarnはエラーをスローせず、npmのように単に省略します。

node.js、yarn、およびオペレーティングシステムのバージョンをお知らせください。

  • NodeJS:v6.1.0
  • 糸:v0.19.0
  • OS:macOS Sierra 10.12.2
cat-bug

全てのコメント3件

うーん、待って。 これは、 https://github.com/resin-io/etcherからyarn add etcher-image-writeを実行した場合にのみ発生します。それ以外の場合は、正常にインストールされます。これは奇妙なことです。

さて、ここで問題の説明を書き直して、元のメッセージが失われないようにします。

https://github.com/resin-io/etcherのYarnに移動するのを楽しみにしていyarn installを実行すると、次のようになります。

$ git clone https://github.com/resin-io/etcher
$ yarn install
yarn install v0.19.0
info No lockfile found.
warning npm-shrinkwrap.json found. This will not be updated or respected. See https://yarnpkg.com/en/docs/migrating-from-npm for more information.
[1/4] 🔍  Resolving packages...
warning [email protected]: this package is no longer updated or maintained
warning [email protected]: electron-prebuilt has been renamed to electron. For more details, see http://electron.atom.io/blog/2016/08/16/npm-install-electron
warning file-tail > [email protected]: this package is no longer updated or maintained
warning etcher-image-write > progress-stream > through2 > xtend > [email protected]:
warning electron-packager > asar > mksnapshot > request > [email protected]: use uuid module instead
[2/4] 🚚  Fetching packages...
warning [email protected]: The platform "darwin" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
warning [email protected]: The platform "darwin" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
error [email protected]: The platform "darwin" is incompatible with this module.
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

私はもともとこの問題はetcher-image-writeに関連していましたが、 yarn add etcher-image-writeetcher/を実行すると同じ結果が得られるためですが、問題はremovedriveから発生しているようです。

このモジュールは、Etcher自体のオプションの依存関係です。

  ...
  "optionalDependencies": {
    "elevator": "^2.1.0",
    "removedrive": "^1.1.1"
  },
  ..

そして、そのWindows専用パッケージ:

  ...
  "os": [
    "win32"
  ],
  ...

元の問題と同じ議論が成り立ちます:

removedriveetcherオプションの依存関係であるため、プラットフォームの不一致がある場合でもYarnはエラーをスローせず、npmのように単に省略します。

私もこの問題を抱えており、次の問題があります。
https://github.com/alykoshin/winston-winlog3
Windows専用モジュールに依存します:
https://github.com/alykoshin/node-windows

package.jsonには次のものがあります

  "optionalDependencies": {
    "winston-winlog3": "^1.0.6"
  },

エラー:
error [email protected]: The platform "darwin" is incompatible with this module.

このページは役に立ちましたか?
0 / 5 - 0 評価