简体   繁体   中英

How can I manually install angular libraries and get all dependencies without using bower or npm?

I'm trying to import some data from an Excel spreadsheet into my angular app. I found the following that details importing them into UI-Grid and using xlsx.js which seems a great basis for me to start.

But I'm currently working behind a very strict corporate firewall and can't get either bower or npm to work. I can just about get nuget working in Visual Studio by setting up a proxy, although even with that I can't download any of the packages that have a dependency on node.js such as any of the npm, bower, grunt packages.

I've managed to get Node.js installed by downloading it on my personal pc and transferring it via usb. But still can't get those nuget packages to install. So I've tried running npm direct in the node.js instance I have successfully downloaded. Still no joy.

I've tried configuring the proxies in numerous different ways but I can't get npm, bower, git or grunt to work.

So I've downloaded the zips of ui-grid and xlsx from github and tried copying the files across to my project manually, but that doesn't seem to be working. Some of their dependencies aren't installed.

I'm new to angular, node, bower, npm so when things aren't totally simple I really need to be able to follow instructions, which in the angular world invariably seems to begin with installing via bower or npm, neither of which I seem to be able to do.

What I want to do is therefore determine the dependencies of the libraries I'm installing. I was guessing that package.json should show me the dependencies. So for xlsx it lists dependencies as :

"dependencies": { 
"ssf":"~0.8.1", 
"codepage":"~1.3.6", 
"cfb":">=0.10.0", 
"jszip":"2.4.0", 
"crc-32":"", 
"adler-32":"", 
"commander":"" 

},

I've also tried using cdn link as a temporary workaround as I'd read that somehow gets dependencies? but still not working:

https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.8.0/xlsx.js

So within the code, where it is erroring is an undefined object. Tracking that object back it is set as _fs = require('f'+'s');

But I can't find where require is defined, although from reading around I'm assuming its require.js, but that isn't listed as a dependency, so am I missing how to determine the dependencies?

People downloaded libraries without npm and bower for decades. Just go to https://code.angularjs.org/ choose what you need and download.

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