Do you want to request a _feature_ or report a _bug_?
Bug, for compatibility with npm
What is the current behavior?
If an optionalDependency install script fails, the whole 'yarn install' fails.
With npm client, these errors are ignored and the install succeeds.
If the current behavior is a bug, please provide the steps to reproduce.
The sinopia npm package has an optionalDependency on fs-ext, whose install script fails in Windows. This is a known issue, but since it is optional the errors get ignored with 'npm install'; but fails with 'yarn'.
In a Windows machine:
yarn add sinopia
This happens even if ignore-optional=true.
If ignore-scripts=true, error goes away.
What is the expected behavior?
'yarn install' prints out the errors, but the installation succeeds.
Please mention your node.js, yarn and operating system version.
node.js 6.7.0
yarn 0.15.1
Windows 10
Related npm bug for packages that use shrinkwrap https://github.com/npm/npm/issues/12698
+1 this is preventing us from using yarn
as a drop-in replacement for npm
.
This is also keeping my team back from switching to yarn.
+1 need this one to be fixed too
+1 me too
having same issue for optional dependency node_modules/fsevents
on yarn 0.17.8
, node v7.2.0
, Ubuntu 14
@shogunsea it's sub-optimal, but you can fix it by deleting the lockfile and running yarn install
in the linux environment. Of course any time someone adds something that depends on fsevents and commits it from osx, the problem will come back.
Is this resolved?
I also got an error printed after yarn add webpack
on an empty project (just ran yarn init
in an empty folder), because it tried to install fsevents
on Windows 10.
I'm using [email protected].
@fhelwanger it should be resolved by #1997 which is not included in 0.17.9.
I guess it'll be part of the next release.
Nice! Thanks!
This issue is still not fixed in 0.17.10
@zaggy It will be in 0.18.0 supposed released this weekend.
0.17.10 was a hotfix release
Is this just ignoring the error? I think there should be a way to not even try to compile it when the package author is confident it won't work on given platform.
Consider this output at the moment:
yarn install v0.17.10
warning [email protected]: The platform "win32" is incompatible with this module.**
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
...
error Error running install script for optional dependency: "C:\\....\\node_modules\\fsevents: Command failed.\nExit code: 1\nCommand: C:\\WINDOWS\\system32\\cmd.exe\nArguments: /d /s /c node-pre-gyp install
There the fsevents says [email protected]: The platform "win32" is incompatible with this module.
, yet it tries to build it. I think this is because there is no way in package.json to say it shouldn't try to compile it with win32, so it's just a warning?
This issue breaks CI builds (TFS), cause incompatible optional packages (fsevents in our case) triggers error in yarn install
step.
@mvestergaard Has your change been released yet? Because it's still happening to me. This is breaking our CI builds. :frowning_face:
Still seeing this issue in v0.21.3.
I have [email protected]_ as optionalDependencies. But yarn install --ignore-optional
fails with these:
error [email protected]: The platform "win32" is incompatible with this module.
error Found incompatible module
npm install
works regardless [email protected]_ is declared as dependencies or optionalDependencies.
node.js 6.5.0
yarn 0.21.3
Windows 10
also 0.27.5 will happily install optionalDependencies
with the flag --ignore-optional
down the chain of dependencies.
For me it's serverless
=> apollo-client
=> @types/isomorphic-fetch
.
Of course it's breaking my builds due to that particular package being outdated for typescript.
can we reopen this issue ? i'm using yarn 1.3.2 and i'm still seeing errors from optional dependencies with the --ignore-optional flag
the optional dependency itself isn't installed , but the errors/warning/info message is still shown
@Aaike, could you please raise a new issue with a clear repro script?
This issue has been here for a while and maybe it is a different regression, much better to deal with it in isolation and in context of latest Yarn
error An unexpected error occurred: "/Users/user/data/projects/mobile/node_modules/node-zopfli: Command failed.
Exit code: 1
node -v 9.8.0
yarn -v 1.5.1
Most helpful comment
Still seeing this issue in v0.21.3.
I have [email protected]_ as optionalDependencies. But
yarn install --ignore-optional
fails with these:error [email protected]: The platform "win32" is incompatible with this module.
error Found incompatible module
npm install
works regardless [email protected]_ is declared as dependencies or optionalDependencies.node.js 6.5.0
yarn 0.21.3
Windows 10