I've just started working with Angular and with Angular-CLI and I've seen that, according to the documentation, I need to install $ npm install -g @angular/cli
with the -g
(global) flag.
However I would like to have Angular-CLI installed locally with the rest of my node_modules packages. This way, when I've download my project from git, I could simply run $ npm install
(for installing all the dependencies in my package.json).
I try to create a new project by running $ npm init
and then run $ npm i @angular/cli -D
(-D
is the same as --save-dev
). But then when I run $ ng new project-name
a new sub directory was created with a separate node_modules directory.
question from:
https://stackoverflow.com/questions/48128847/how-to-install-angular-cli-locally-without-the-g-flag 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…