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.
How can I:
- Install node packages globally that are available to all users.
- I want to use a locally hosted node registry. I don't want to use node registry.
- After the installing the packages, how can I validate if all users can access the packages?
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.
In short:
- Open an administrator level command prompt
- Note the current global prefix:
npm prefix -g
- Set the global prefix to the CI user:
npm config set prefix <C:\Users\CI_USER\AppData\Roaming\npm>
- Install the needed packages:
npm i -g PKG
- Restore the prefix to the previous value.
For the 'Network Service' account use the folder:
C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\npm
You can add a global environment variable NODE_PATH
to set the package require search path. You may see here for more.
https://gist.github.com/branneman/8048520#4-the-environment