使 Windows 2012 服务器上的所有用户都可以使用全局 NPM 包 [英] Making Global NPM packages available to all users on windows 2012 server

查看:55
本文介绍了使 Windows 2012 服务器上的所有用户都可以使用全局 NPM 包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装持续集成服务器.该服务器将从 GIT 中提取数据并尝试构建应用程序.由于我使用的是 windows 2012 服务器,因此多个用户可以触发构建.为此,我想确保我以管理员身份安装的所有节点包都可供所有用户使用.

I am trying to install continues integration server. This server will pull data from GIT and it will try to build the application. Since I am using windows 2012 server, multiple users can trigger the build. For this purpose, I want to ensure all the node packages I install as admin are available to all users.

我该怎么做:

  1. 全局安装所有用户都可以使用的节点包.
  2. 我想使用本地托管的节点注册表.我不想使用节点注册表.
  3. 安装软件包后,如何验证是否所有用户都可以访问软件包?

推荐答案

遇到了同样的问题.需要 CI 构建代理才能在 CLI 上运行全局包.在系统范围的新功能请求中看到这篇文章npm -g 用于 Windows.

Had the same issue. Needed the CI build agent to run a global package on the CLI. Saw this post in a new feature request for system-wide npm -g for Windows.

简而言之:

  1. 打开管理员级别的命令提示符
  2. 注意当前的全局前缀:npm prefix -g
  3. 为 CI 用户设置全局前缀:npm config set prefix
  4. 安装需要的包:npm i -g PKG
  5. 将前缀恢复为以前的值.

这篇关于使 Windows 2012 服务器上的所有用户都可以使用全局 NPM 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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