为什么npm install

编程入门 行业动态 更新时间:2024-10-26 18:25:44
本文介绍了为什么npm install -g @ angular / cli?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我知道有关安装此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

本文发布于:2023-06-08 14:30:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/583095.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:npm   install

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!