Yarn: يصر الغزل على تثبيت التبعيات الاختيارية الخاصة بالنظام الأساسي

تم إنشاؤها على ١٢ يناير ٢٠١٧  ·  3تعليقات  ·  مصدر: yarnpkg/yarn

هل تريد طلب ميزة أو الإبلاغ عن خطأ ؟

حشرة.

ما هو السلوك الحالي؟

أحاول إضافة الوحدة النمطية etcher-image-write ، والتي تحتوي على تبعية اختيارية خاصة بـ Windows:

  ...
  "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 ، يجب ألا يتسبب الغزل في حدوث خطأ إذا كان هناك عدم تطابق في النظام الأساسي ، وقم ببساطة بحذفه ، مثل npm.

يرجى ذكر node.js والغزل وإصدار نظام التشغيل.

  • NodeJS: v6.1.0
  • الغزل: v0.19.0
  • نظام التشغيل: macOS Sierra 10.12.2
cat-bug

ال 3 كومينتر

حسنًا ، انتظر. يحدث هذا فقط عندما أقوم بتشغيل yarn add etcher-image-write من https://github.com/resin-io/etcher ، وإلا فإنه يتم تثبيته على ما يرام ، وهو أمر غريب.

حسنًا ، سأعيد كتابة وصف المشكلة هنا ، حتى لا تضيع الرسالة الأصلية:

نتطلع إلى الانتقال إلى Yarn من أجل https://github.com/resin-io/etcher. هذا ما أحصل عليه إذا قمت باستنساخ الريبو وتشغيله 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 ، يجب ألا يتسبب الغزل في حدوث خطأ إذا كان هناك عدم تطابق في النظام الأساسي ، وقم ببساطة بحذفه ، مثل npm.

أواجه هذه المشكلة أيضًا ، مع ما يلي:
https://github.com/alykoshin/winston-winlog3
يعتمد على وحدة ويندوز فقط:
https://github.com/alykoshin/node-windows

لدينا ما يلي في مجموعتنا. json

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

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

هل كانت هذه الصفحة مفيدة؟
0 / 5 - 0 التقييمات