1

I am following a tutorial for making an web app with ASP.NET Core using visual studio and it calls to install jQuery and bootstrap dependencies with npm, leading to the following file structure:

file structure for dependencies

file structure for dependencies

In order for me to be able to use the following methods:

app.UseNodeModules() method

However, the proxy on my computer keeps blocking npm, giving me the following error:

npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! network request to https://registry.npmjs.org/bootstrap failed, reason: read ECONNRESET
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\[...]debug.log

(I have tried changing the firewall but the domain network settings prevent me from doing so)

Is there any other way for me to be able to install these files manually in order to give me the same file structure so that it can be accessed with the correct methods? Or if not, is there another way around this problem?

Weirdali
  • 413
  • 1
  • 7
  • 16
  • NPM needs some configuration to work behind a proxy. For example see https://stackoverflow.com/q/25660936/67392 – Richard Mar 04 '20 at 10:04
  • bootstrap and jquery are just collections of js/css files, so you could manually download them and copy them to your wwwroot folder. NPM will just help you managing your packages but it's not necessary to use external js libraries – Elias Johannes Mar 04 '20 at 10:48
  • @EliasJohannes How would I then access them using an equivalent of app.UseNodeModules()? – Weirdali Mar 04 '20 at 11:04
  • Just import the files in your main Layout file using script and link tags. Usually you only need the `jquery.js`, the `popper.js` and both `bootstrap.js` and `bootstrap.css` in this order and you are ready to use bootstrap 4 – Elias Johannes Mar 04 '20 at 12:58

0 Answers0