Yarn: Default argumenst for yarn in package.json or .yarnrc

Created on 29 Apr 2017  路  9Comments  路  Source: yarnpkg/yarn

At least I didn't found if it is possible now.
The case: in package json there is a dependency that required old node version (though it actually work ok), so need to use --ignore-engines flag, it would be nice if ti would be possible to specify for example in pakcage.json:

"yarn": {
  "args": ["ignore-engines"]
}

Or use .yarnrc for specifying this.

triaged

Most helpful comment

In .yarnrc --install.ignore-engines true

All 9 comments

+1 I work in an organization where the ignore-engines default behavior is super unpractical.

BTW https://github.com/whitecolor/yall supports this you can add to package.json:

"yarn": {
   args: ["--ignore-engines"]
}

@bestander close

Forcing developers to pass the --ignore-engines flag explicitly is by design; see this comment.

This issue actually has nothing to dot with implicitness/explicitness of particular arguments (--ignore-engines), but simplier management of the process of deps installations. Deafult arguments for particular project/folder, not the whole environment.

@whitecolor explicitness by design means that users are required to pass in the --ignore-engines flag explicitly every time whenever relevant commands are invoked. Hiding the flag inside a config file so users don't need to remember to type it every time does not seem to go by the intention of this design.

Regarding the part about adding or modifying package.json or .yarnrc, the current rule mandates that such request should undergo the RFC process.

In .yarnrc --install.ignore-engines true

for global add
--global.ignore-engines true

FWIW, I'm using alias yarn='yarn --ignore-engines'

For me the following is enough:

$ cat .yarnrc
--ignore-engines true

https://github.com/microsoft/vscode-generator-code/issues/223

Was this page helpful?
0 / 5 - 0 ratings