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:
NPM installs global packages into /<User>/local/lib/node_modules folder. Apply -g in the install command to install package globally.
When you install a package using npm you can perform 2 types of installation: a local install. a global install.
To install a module from npm globally, you'll simply need to use the --global flag when running the install command to have the module install globally, rather than locally (to the current directory). Note: One caveat with global modules is that, by default, npm will install them to a system directory, not a local one.
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:
npm prefix -g
npm config set prefix <C:\Users\CI_USER\AppData\Roaming\npm>
npm i -g PKG
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With