Im trying to setup a new project with angular cli and have set my package manger like this:
ng set --global packageManager=yarn
However, when I try to create a new angular project with cli, I get this
Installing packages for tooling via yarn. 'yarn' is not recognized as an internal or external command, operable program or batch file. Package install failed, see above. Package install failed, see above.
So then I start looking to see if I have yarn even installed and I do this:
D:\devsrc>npm list -g --depth=0
and get this:
C:\Users\me\AppData\Roaming\npm +-- @firstname.lastname@example.org +-- email@example.com `-- firstname.lastname@example.org npm ERR! peer dep missing: rxjs@^5.0.1, required by @email@example.com npm ERR! extraneous: firstname.lastname@example.org C:\Users\
How can I have 2 different versions of angular cli installed?
How can I clean this up and get Yarn installed?
So first thing, you are getting
'yarn' is not recognized as an internal or external command error is because you do not have
yarn globally installed run
npm install yarn -g to fix that
Second you have two
email@example.com packages is because the
angular cli package name has being changed since version
1.0.0-beta.28.3. Before it was
angular-cli now it is
@angular/cli so just uninstall the old one
uninstall angular-cli -g. After that you might need to reinstall the latest one
npm install @angular/cli -g
Answered By – angularrocks.com
Answer Checked By – Pedro (AngularFixing Volunteer)