Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
Yarn refuses to install with --production when there is devDependency specified with incompatible engine.
If the current behavior is a bug, please provide the steps to reproduce.
eslint ^5.6.1 in devDependenciesyarn --production.error [email protected]: The engine "node" is incompatible with this module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0". Got "9.6.1"
error Found incompatible module
What is the expected behavior?
Yarn should ignore incomatible engine, as it shouldn't install devDependencies in production mode anyway.
Please mention your node.js, yarn and operating system version.
dzek@raspberrypi:~/tmp/services/reader/app $ npm -v
5.6.0
dzek@raspberrypi:~/tmp/services/reader/app $ node -v
v9.6.1
dzek@raspberrypi:~/tmp/services/reader/app $ yarn -v
1.13.0
dzek@raspberrypi:~/tmp/services/reader/app $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
dzek@raspberrypi:~/tmp/services/reader/app $
I've also seen this when deploying on Microsoft Azure Linux containers:
node 8.10
2019-04-01T22:21:39.821376124Z > yarn --production && yarn build
2019-04-01T22:21:39.821381524Z
2019-04-01T22:21:41.201198357Z yarn install v0.24.6
2019-04-01T22:21:42.260739983Z [1/4] Resolving packages...
2019-04-01T22:21:45.227422597Z [2/4] Fetching packages...
2019-04-01T22:23:28.455548320Z error [email protected]: The engine "node" is incompatible with this module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0".
2019-04-01T22:23:28.463155889Z error Found incompatible module
2019-04-01T22:23:28.463486384Z info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
2019-04-01T22:23:28.733288456Z npm info lifecycle [email protected]~prestart: Failed to exec prestart script
2019-04-01T22:23:28.733843146Z npm ERR! code ELIFECYCLE
2019-04-01T22:23:28.734378637Z npm ERR! errno 1
Notice the same problem. The devDeps are still downloaded and checked.

Most helpful comment
I've also seen this when deploying on Microsoft Azure Linux containers:
node 8.10