yarnpkg/yarn

Yarn remove does not produce atomic results when missing --ignore-engines flag

Open

#2.934 geöffnet am 16. März 2017

Auf GitHub ansehen
 (1 Kommentar) (3 Reaktionen) (0 zugewiesene Personen)JavaScript (41.514 Stars) (2.731 Forks)batch import
good first issuehelp wantedtriaged

Beschreibung

Yarn Version: 0.21.3 Node: v7.7.1 OS: OS X El Capitan 10.11.6

Current Behavior: Install a set of modules and passing "--ignore-engines" to allow version mismatches will install all modules and update the yarn.lock When removing any module (does not need to be the one with a version mismatch) if the "--ignore-engines" flag is not passed, the remove command will take the module out of node_modules but not remove it from yarn.lock, causing subsequent calls to remove to fail with "This module isn't specified in a manifest."

Steps to Reproduce:

$ yarn add module1 (a module that requires --ignore-engines) module2 --ignore-engines
# See yarn.lock and node_modules updated without problem
$ yarn remove module2
# See yarn.lock is not updated, but node_modules no longer has the module
# yarn remove v0.21.3
# error <redacted>: The engine "node" is incompatible with this module. Expected version "^4.5.0".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/remove for documentation about this command.
# Use correct command
$ yarn remove module2 --ignore-engines
# # yarn remove v0.21.3
# [1/2] Removing module <redacted>...
# error This module isn't specified in a manifest.
# info Visit https://yarnpkg.com/en/docs/cli/remove for documentation about this command.

Expected Behavior:

If the first call to remove fails because of missing --ignore-engines, the package should not be removed from the manifest, everything should fail, so on subsequent calls, the corrected "--ignore-engines" request can succeed.

Some items <redacted> because of company modules / packages

Contributor Guide