同一台电脑上的angular-cli不同版本 [英] angular-cli different versions in the same computer

查看:48
本文介绍了同一台电脑上的angular-cli不同版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在几个项目中使用 Angular2.每个项目都使用不同版本的 angular-cli,因此,我需要能够使用正确版本的 angular-cli 分别运行和编译生产.当我使用 save-dev 在本地安装 angular-cli 时,未找到 ng 命令,因此我无法为该项目创建构建分发版.

I'm working with Angular2 in several projects. Each of this projects uses a different version of angular-cli, so, I need to be able to run and compile for production each separately with the correct version of angular-cli. When I installed angular-cli locally using save-dev, ng commands not found so I cannot create a build distribution for the project.

所以问题是,如何在同一台机器上有多个 angular-cli 版本,而无需全局安装(使用 -g 选项)?,可以在不安装 angular-cli 全局?

So the question are, how can I have multiples angular-cli version in the same machine, without installed globally (with -g option)?, it is possible run ng commands without installing angular-cli globally?

推荐答案

你可以使用 NVM 这是一个节点版本管理器,允许您在每个节点版本中使用不同的全局模块.

You could use NVM which is a Node Version Manager and allows you to work with different global modules in each Node version.

就我而言,我在一个项目中使用 Node 6.9.5 和 Angular2,在另一个项目中使用 Node 10 和 Angular6.

In my case, I'm working with Node 6.9.5 and Angular2 in one project, and Node 10 and Angular6 in other.

您只需要注意哪个版本就座并像您一样正常工作.

You only have to pay attention which version is seated and work as normally as you do.

这篇关于同一台电脑上的angular-cli不同版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆