简体   繁体   English

'npm update' 可以使用全局包吗?

[英]Can 'npm update' use global packages?

If I have a Node.js package with a missing node_modules folder.如果我有一个缺少node_modules文件夹的 Node.js package。 Executing the npm update command will create and properly populate the node_modules folder with all the necessary packages.执行npm update命令将使用所有必要的包创建并正确填充node_modules文件夹。

What I don't understand is;我不明白的是;

  1. Why does it include packages which are already present in the global node_modules folder?为什么它包含全局node_modules文件夹中已经存在的包?

  2. Why will it not create folder links instead?为什么它不会创建文件夹链接?

  3. Am I missing a command line parameter?我是否缺少命令行参数?

Thanks!谢谢!

Edit :编辑

  1. Running the npm update -g command will not solve the problem.运行npm update -g命令不会解决问题。

  2. I don't know if it is relevant information, but I'd like to solve it in Windows OS.不知道是不是相关资料,但我想在Windows OS中解决。

Global and local packages are treated differently (rightly so.).全局和本地包的处理方式不同(这是正确的。)。

npm update -g will update all global packages npm update -g将更新所有全局包

This is documented here .在此处记录。

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

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