Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Yarn --ignore-optional flag is not working #705

Closed
Sh1d0w opened this issue Oct 11, 2016 · 10 comments
Closed

[BUG] Yarn --ignore-optional flag is not working #705

Sh1d0w opened this issue Oct 11, 2016 · 10 comments

Comments

@Sh1d0w
Copy link

Sh1d0w commented Oct 11, 2016

Do you want to request a feature or report a bug?
It's a bug.

What is the current behavior?
While doing yarn install on the freshly checked out repo here https://github.com/brave/browser-laptop
the command fails with:

yarn --ignore-optional
yarn install v0.15.1
info No lockfile found.
[1/4] Resolving packages...
warning babel@6.5.2: Babel's CLI commands have been moved from the babel package to the babel-cli package
warning mocha > glob > minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning flow-bin > bin-wrapper > globby > glob > minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning mocha > to-iso-string@0.0.2: to-iso-string has been deprecated, use @segment/to-iso-string instead.
warning mocha > jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
warning font-awesome-webpack > css-loader > cssnano > css-list@0.1.3: Deprecated.
warning font-awesome-webpack > css-loader > cssnano > postcss-merge-idents > css-list@0.1.3: Deprecated.
warning electron-builder > progress-stream > through2 > xtend > object-keys@0.4.0: 
warning gulp > vinyl-fs > glob-watcher > gaze > globule > minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning gulp > vinyl-fs > glob-watcher > gaze > globule > glob > graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
[2/4] Fetching packages...
warning assert@0.4.9: The engine "ender" appears to be invalid.
warning appdmg@0.3.10: The platform "linux" is incompatible with this module.
info "appdmg@0.3.10" is an optional dependency and failed compatibility check. Excluding it from installation.
error macos-alias@0.2.11: The platform "linux" is incompatible with this module.
error Found incompatible module
info Visit http://yarnpkg.com/en/docs/cli/install for documentation about this command.

Yarn must not try to install packages that are not for that OS and should not fail on such cases. This deps are not defined in the package.json file. yarn --ignore-optional has no effect too.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Check out the repo (Under Linux, reproduced with Fedora 24) https://github.com/brave/browser-laptop
  2. Run yarn

What is the expected behavior?
Doing npm install installs all dependencies correctly without errors.

Please mention your node.js, yarn and operating system version.
node 5.6.0
yarn 0.15.1
Fedora 24, Linux

@Sh1d0w Sh1d0w changed the title [BUG] Yarn install fails on Linux [BUG] Yarn install fails when there are packages for other OS Oct 11, 2016
@Jessidhia
Copy link

macos-alias is a regular (i.e. mandatory) dependency of ds-store, which is a regular dependency of appdmg, which is a regular dependency of electron-builder. electron-builder is a devdep of browser-laptop.

This is an unbroken chain of mandatory dependencies 😕

AFAICT, electron-builder should make appdmg an optionalDependency; but if it's optional and not installed, calling it with platform: 'osx' will crash at runtime.

@Sh1d0w
Copy link
Author

Sh1d0w commented Oct 12, 2016

Actually @Kovensky I think you are wrong. It is an optinal dependency:

https://github.com/brave/electron-builder/blob/master/package.json#L93

So I think yarn --ignore-optional just does not work .... as well as this message is wrong then:

info "appdmg@0.3.10" is an optional dependency and failed compatibility check. Excluding it from installation.

@Jessidhia
Copy link

@Sh1d0w ah, I was looking at the generated package.json inside node_modules/electron-builder, which does list it in the dependencies key.

@Sh1d0w
Copy link
Author

Sh1d0w commented Oct 12, 2016

@Kovensky You are right it is in the generated file. But https://github.com/brave/browser-laptop/blob/master/package.json defines dependency "electron-builder": "^2.3.1", which in its package.json does not have appdmg https://github.com/electron-userland/electron-builder/blob/master/package.json

As pointed npm install works flawlessly so it must be yarn doing something wrong.

@Sh1d0w
Copy link
Author

Sh1d0w commented Oct 12, 2016

As a conclusion I think that --ignore-optional is just not working so I am changing the title of the issue.

Doing npm install (installation completes successfully with warnings for optional deps)

npm WARN optional Skipping failed optional dependency /electron-builder/appdmg:
npm WARN notsup Not compatible with your operating system or architecture: appdmg@0.3.10

Doing yarn --ignore-optional (installation fails with error)

info "appdmg@0.3.10" is an optional dependency and failed compatibility check. Excluding it from installation.
error macos-alias@0.2.11: The platform "linux" is incompatible with this module.
error Found incompatible module

@Sh1d0w Sh1d0w changed the title [BUG] Yarn install fails when there are packages for other OS [BUG] Yarn --ignore-optional flag is not working Oct 12, 2016
@Jessidhia
Copy link

The mystery, then, is why does it work on the chokidar > fsevents chain that webpack brings in.

@Sh1d0w
Copy link
Author

Sh1d0w commented Oct 12, 2016

@Kovensky I think it isn't it just fails before it even gets to that point.

This is npm install at the end :

npm WARN optional Skipping failed optional dependency /electron-builder/appdmg:
npm WARN notsup Not compatible with your operating system or architecture: appdmg@0.3.10
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14

But yarn breaks too soon when it gets to the point to install appdmg (which it shouldn't because I want to skip optional deps)

@Jessidhia
Copy link

Jessidhia commented Oct 12, 2016

@Sh1d0w I mean, it works fine if I create a lockfile in a mac on a project that depends on webpack and then try to install it on linux -- fsevents gets skipped as an optional dependency:

warning fsevents@1.0.14: The platform "linux" is incompatible with this module.
info "fsevents@1.0.14" is an optional dependency and failed compatibility check. Excluding it from installation.

I wonder if the problem is when it has to create a lockfile?

@Sh1d0w
Copy link
Author

Sh1d0w commented Oct 19, 2016

@kittens Any info on this? It is pretty serious issue and blocks install of packages on OSes that have not supported packages of packages as optional deps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants