简体   繁体   English

Angular 2 npm全局安装(如何全局安装软件包,因此无需每次npm install命令都运行)

[英]Angular 2 npm install globally (how to install package globally so no need to run every time npm install command)

AngularJS2 AngularJS2

How to install a package globally? 如何在全球范围内安装软件包? In Angular 2 npm installs globally. Angular 2 npm全局安装。

In that every time I need to run npm install (on the basis of package.json ) and it is very time consuming can you help me how to installed a package globally so every time I can refer that path and no need to run npm install command. 每次我需要运行npm install (基于package.json )时,这非常耗时,您能帮助我如何全局安装软件包吗,所以每次我都可以引用该路径而无需运行npm install命令。

I guess this should do it, but I personally, don't think it's a good idea to keep everything installed globally. 我想应该这样做,但是我个人认为将所有内容都安装在全球范围内并不是一个好主意。

npm install -g npm安装-g

The global package is just for the cli tool. 全局软件包仅用于cli工具。 NPM install is to keep your project up-to-date. NPM install是为了使您的项目保持最新。 I think the only way to do this is to install it in a specific folder then copy the hold folder to anywhere you want although it's not a good idea! 我认为这样做的唯一方法是将其安装在特定文件夹中,然后将保留文件夹复制到您想要的任何位置,尽管这不是一个好主意!

If nothing unusual, things would go right! 如果没有异常,一切都会好的!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM