You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running ng new I get a message that I can switch the package manager to yarn. However this is a global change. What I would like is to add an option, e.g. --package-manager=yarn, so that I can set the package manager for this specific new project. I'd also like this selection to be stored on a per-project basis, either in .angular-cli.json or possibly guessed from existence of yarn.lock. The former requires a change in file structure, but is more future-proof, as the cli already supports cnpm as well,
Rationale for the latter - assume I'd like to work on several projects, when some of them are using yarn, and others are using npm. Using the wrong package manager will cause issues, as it will install different packages. Currently it requires switching between package managers on a global basis.
Rationale for the former: The choice of the package manager is a project choice, not a global choice. A global default is fine, as most people will have a strong preference, but just allow for the choice to be made when it really matters.
The text was updated successfully, but these errors were encountered:
Currently, the only time the CLI uses the package manager is during the execution of ng new. This is why it is a global only setting. If a project requires a specific package manager, the --skip-install option can be used with ng new and then after creation the particular package manager (npm/yarn/cnpm/pnpm/etc.) can be used to install.
If in the future, the package manager is used for more than ng new, then the initial one-time workflow would most likely be similar to the following if the global default is undesirable for the project:
ng new <project> --skip-install
cd <project>
ng set packageManager=yarn
yarn
#2651 (comment) says otherwise. I've checked node_modules/@angular/cli in a new project, and npm appears in 74 places, mostly in README and comments, so is the comment outdated (It's over a year old)?
Versions
Desired behavior
When running
ng new
I get a message that I can switch the package manager to yarn. However this is a global change. What I would like is to add an option, e.g.--package-manager=yarn
, so that I can set the package manager for this specific new project. I'd also like this selection to be stored on a per-project basis, either in.angular-cli.json
or possibly guessed from existence ofyarn.lock
. The former requires a change in file structure, but is more future-proof, as the cli already supports cnpm as well,Rationale for the latter - assume I'd like to work on several projects, when some of them are using yarn, and others are using npm. Using the wrong package manager will cause issues, as it will install different packages. Currently it requires switching between package managers on a global basis.
Rationale for the former: The choice of the package manager is a project choice, not a global choice. A global default is fine, as most people will have a strong preference, but just allow for the choice to be made when it really matters.
The text was updated successfully, but these errors were encountered: