機能をリクエストしバグを報告しますか?
バグ。
現在の動作は何ですか?
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
期待される動作は何ですか?
diskpart
はetcher-image-write
オプションの依存関係であるため、プラットフォームの不一致がある場合でもYarnはエラーをスローせず、npmのように単に省略します。
node.js、yarn、およびオペレーティングシステムのバージョンをお知らせください。
うーん、待って。 これは、 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-write
でetcher/
を実行すると同じ結果が得られるためですが、問題はremovedrive
から発生しているようです。
このモジュールは、Etcher自体のオプションの依存関係です。
...
"optionalDependencies": {
"elevator": "^2.1.0",
"removedrive": "^1.1.1"
},
..
そして、そのWindows専用パッケージ:
...
"os": [
"win32"
],
...
元の問題と同じ議論が成り立ちます:
removedrive
はetcher
オプションの依存関係であるため、プラットフォームの不一致がある場合でも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.