Yarn: Yarn besteht darauf, plattformspezifische optionale Abhängigkeiten zu installieren

Erstellt am 12. Jan. 2017  ·  3Kommentare  ·  Quelle: yarnpkg/yarn

Möchten Sie eine Funktion anfordern oder einen Fehler melden?

Ein Käfer.

Wie ist das aktuelle Verhalten?

Ich versuche, das Modul etcher-image-write hinzuzufügen, das eine Windows-spezifische optionale Abhängigkeit enthält:

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

Das Modul diskpart deklariert in seinem package.json , das nur unter Windows installiert werden kann:

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

Ich erhalte jedoch die folgende Ausgabe, wenn ich versuche, etcher-image-write hinzuzufügen:

$ 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.

Wenn das aktuelle Verhalten ein Fehler ist, geben Sie bitte die Schritte zum Reproduzieren an.

yarn add etcher-image-write

Was ist das erwartete Verhalten?

Da diskpart eine optionale Abhängigkeit von etcher-image-write , sollte Yarn bei einem Plattformkonflikt keinen Fehler ausgeben und ihn einfach weglassen, wie npm.

Bitte geben Sie Ihre node.js-, Garn- und Betriebssystemversion an.

  • NodeJS: v6.1.0
  • Garn: v0.19.0
  • Betriebssystem: macOS Sierra 10.12.2
cat-bug

Alle 3 Kommentare

Hm, warte. Dies passiert nur, wenn ich yarn add etcher-image-write von https://github.com/resin-io/etcher ausführe, ansonsten wird es gut installiert, was seltsam ist.

Okay, ich werde die Problembeschreibung hier umschreiben, damit die ursprüngliche Nachricht nicht verloren geht:

Wir freuen uns, für https://github.com/resin-io/etcher zu Yarn zu wechseln yarn install darauf ausführe:

$ 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.

Ich dachte ursprünglich, dass das Problem mit etcher-image-write , da yarn add etcher-image-write auf etcher/ die gleichen Ergebnisse liefert, aber das Problem scheint von removedrive .

Dieses Modul ist eine optionale Abhängigkeit von Etcher selbst:

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

Und es ist ein reines Windows-Paket:

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

Das gleiche Argument aus der ursprünglichen Ausgabe gilt:

Da removedrive eine optionale Abhängigkeit von etcher , sollte Yarn bei einem Plattformkonflikt keinen Fehler ausgeben und ihn einfach weglassen, wie npm.

Ich habe dieses Problem auch mit folgendem:
https://github.com/alykoshin/winston-winlog3
hängt von einem Nur-Windows-Modul ab:
https://github.com/alykoshin/node-windows

wir haben folgendes in unserem package.json

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

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

War diese Seite hilfreich?
0 / 5 - 0 Bewertungen