It can be better to use ‘yarn’ as a package manager instead of ‘npm’. This is because ‘yarn’ will not install a dependency again if it has already been installed for another package. In this way ‘yarn’ is faster and more efficient.
To set yarn globally for Angular4.
$ ng set --global packageManager=yarn