yo icon indicating copy to clipboard operation
yo copied to clipboard

Yo 3.0.0 not installable with yarn on node8 due to global-agent requiring node10

Open fluff opened this issue 5 years ago • 2 comments

Type of issue

Bug

Yo 3.0.0 fails to install with yarn on node8, because the dependency global-agent requires node10.

Apparently "yarn add" evaluates the "engines" requirements of dependencies and refuses to install, but "npm install" seems to be happy to put global-agent in node_modules even if it has an "engines" requirement that is not satisfied?


My environment

  • OS version/details: Debian Linux 9 amd64
  • Node version: 8.16.0
  • npm version: 6.4.1
  • yarn version: 1.16.0
  • Version of yo : 3.0.0 (run yo --version in your terminal)

Expected behavior

In an empty directory, the following command used to work to install yeoman: yarn add yo. But since the 3.0 release a few days ago, this has stopped working on node8.

Current behavior

Yarn refuses to install yo on node 8 because it has a dependency [email protected] which requires node 10.

Steps to reproduce the behavior

yarn add yo in an empty directory with node 8 in the path.

Command line output

yarn add v1.16.0
info No lockfile found.
[1/4] Resolving packages...
warning yo > fullname > passwd-user > execa > [email protected]: cross-spawn no longer requires a build toolchain, use it instead
warning yo > yeoman-doctor > bin-version-check > bin-version > execa > [email protected]: cross-spawn no longer requires a build toolchain, use it instead
[2/4] Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=10.0". Got "8.16.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

fluff avatar Jul 03 '19 09:07 fluff

You can use the --ignore-engines when using yarn: https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-ignore-engines

I'm not sure how we can fix that on our side without removing functionality. Maybe we could leverage optionalDependencies, but then we'd need to conditionally require this module only if it is installed.

SBoudrias avatar Jul 03 '19 09:07 SBoudrias

Thanks, --ignore-engines did the trick. Feel free to close this issue - or leave it open still, in case this is something that could be improved later.

fluff avatar Jul 03 '19 09:07 fluff