How to ignore incompatible "node" engine when installing npm dependencies with yarn?

Given this package.json:

{
  "name": "yarn-install-fail",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {},
  "author": "",
  "license": "ISC",
  "dependencies": {
    "aws-sdk": "2.x.x",
    "s3-streams": "^0.3.0"
  }
}

I can install dependencies successfully through npm:

$ npm install

added 27 packages in 1.844s

However, the thread does not work:

$ yarn install
yarn install v0.24.5
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
error s3-streams@0.3.0: The engine "node" is incompatible with this module. Expected version "^1.2.0".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

It seems that the yarn has problems installing the library s3-streams@0.3.0, but I assumed that it would refuse to install all the dependencies anyway, like npm.

+36
source share
2 answers

You can really ignore such errors with - ignore-engines :

$ yarn install --ignore-engines
yarn install v0.24.5
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 1.41s.

This is also described in the command help:

$ yarn help | grep -- --ignore
    --ignore-scripts                  don't run lifecycle scripts
    --ignore-platform                 ignore platform checks
    --ignore-engines                  ignore engines check
    --ignore-optional                 ignore optional dependencies
+64
source

"yarn config set ignore-engine true" - " ". , "-- "

+14

Source: https://habr.com/ru/post/1681383/


All Articles