简体   繁体   English

节点程序包优先级,全局与本地

[英]Node package priority, global vs local

I've noticed that I have Angular 2 installed globally, and I don't know when I might have done that, or if that's the way it's supposed to be. 我注意到我已经在全球范围内安装了Angular 2,但我不知道什么时候可以完成安装,或者那是否是应该的方式。 It doesn't seem like that would be necessary if it's defined in every project. 如果在每个项目中都定义了它,那似乎没有必要。

It makes me wonder what side effects that have if I had different versions locally and globally. 这让我想知道如果我在本地和全局使用不同的版本会有什么副作用。 Which one takes priority? 哪一个优先? What's the best way to remove all of the Angular packages. 删除所有Angular软件包的最佳方法是什么。

Globally installed NPM packages really only impact your command-line environment. 全局安装的NPM软件包实际上仅会影响您的命令行环境。 Things like pm2 or sequelize insert bin/ stubs into the PATH to make your life easier. 喜欢的东西pm2sequelize插入bin/存根到PATH ,使您的生活更轻松。

In order to require something it needs to be present in package.json as well as properly installed. 为了require某些东西,它必须存在于package.json中并正确安装。

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

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