简体   繁体   中英

How to install Npm module on offline build server?

We have an single page application developed in angular js using nodejs\\npm\\grunt . I am tyring to integrate this into an asp.net 4.5 mvc project. For the most part of it, I was able to preserve the DEV environment by using the new task runner functionality in VS. I changed the build events to run npm\\bower install and do a grunt build before the .net code builds. But I realized that our build server isn't connected to Internet and thus can't restore node and bower packages I am not able to checkin the node packages into TFS as some of the have very long paths that are incompatible with most of windows tools. Is there any way to get around this issue ie can we install node & bower packages from offline source on the build servers? Thanks.

Assuming your build server is on a local network, you could set up a local npm registry and mirror the required packages there. You'd then just need to set the registry url by using the --registry command line flag or by setting npm_config_registry as an environment variable. There are instructions on how to set up a node registry on clock.co.uk .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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