我知道有关安装此npm软件包的问题很多,但我找不到确切的相关答案,我已经安装了npm并在VStudio中开发了很少的应用程序,每次开发有角度的新项目之前我们需要通过在cmd中键入以下内容来再次安装npm: npm install -g @ angular / cli?
解决方案@ angular / cli全局,在下一个项目中,您只需要运行 ng新的应用程序名称。此命令将创建一个名为 app-name的文件夹,
全局安装@ angular / cli允许您在任何地方使用'ng'命令。需要在本地安装,因为
如果您的项目的@ angular / cli版本比本地项目版本新,则
ng'将使用本地@ angular / cli代替,当您
恢复:使用 npm install -g @ angular / cli ,则只需运行 ng个新的应用程序名称。
I know there are lot many question regarding this npm package installing but I couldn't find the exact relevant answer, I have already installed npm and also developed few applications in my VStudio, Every time before developing the new project of angular do we need to install npm again by typing this in cmd "npm install -g @angular/cli?
解决方案Once you have installed @angular/cli globally, in the next project you just need run ng new app-name. This command will create a folder named 'app-name', than will install all dependencies locally - including @angular/cli.
Installing @angular/cli globally allow you to use 'ng' command everywhere. It's required to install locally because to your project, some specific @angular/cli version is required and newer versions maybe brake.
If your @angular/cli global is newer than the local project version, 'ng' will use the local @angular/cli instead, when you run 'ng serve', for example.
Resume: after installed using npm install -g @angular/cli, you will need just to run ng new app-name.
更多推荐
为什么npm install
发布评论