Create an offline installer of npm package - node.js

Problem:
I have a very flaky internet connection at my place.
Due to this when I try to do
npm install -g glup
it stops the download before completion.
I have tried downloading several times but all in vain.
Thinking about my options
I have a friend in other city with high speed internet, I can ask him to somehow package the glup and provided it to me using dropbox, then i can use any download manager to download it partially with my flaky connection.
But the sad thing is he doesn't know how to do it. (help on this front is also appreciated)
Can anyone help me out with this situation?
P.S: I am doing a course from Udacity and due to my flaky internet connection I am kind of facing lot of issues.

According to the docs, npm install supports installing from a tarball file sitting on your filesystem. So, as long as your friend can create and supply you a tarball of the npm package you are looking for - you should be good to go.
Below is a quote from the docs.
UPDATE: To create a tarball file from an npm package, you can just run npm pack package_name. For example,
npm pack underscore
will create a .tgz file for the latest version of underscore.js npm package. See the documentation for npm pack here.

Not answering directly your question, but I was just struggling with network connection behind a corporate firewall with npm for hours. Then I tried yarn, the package manager from Facebook. Wow, it worked like a charm, install of the package I needed plus deps. done within a minute.

Related

Why do I receive deprecated package warnings when using npm install

I hope you are doing well!
I got asked about why should I use -f to force npm install packages to install. In the documentation it states that
force npm to fetch remote resources even if a local copy exists on disk.
But does this mean that it redownloads global packages for the local project or what does it solve exactly?
Another thing happens is when I use npm install, I see a lot of warnings in the console that
WARNING: X package is deprecated
But when I run npm outdated I see that all packages are all fairly up to date (all match the recommended version to download), so I assume this might be a dependency for a certain package. But does it affect our work negatively? Why does this happen?
For the packages I download, I generally look for packages that have in the 6 digits Weekly Downloads from npm so I don't think we are using unfamiliar packages.
I am asking these questions because they have been asked to me but I don't have a straight answer to them.
Thank You!
I don't understand how npm install -f works

How to make `npm install <package_a>` actually install `#myfancyname/package_a`

Let's say I published few years back a npm package package_a.
Now I actually "namespaced" all my packages under #myfancyname/package_a.
Is there a way to transform package_a install process so that
npm install -g package_a
actually just run
npm install -g #myfancyname/package_a
(of course this should work also for npm install package_a -> npm install #myfancyname/package_a)
This might be bad practice, so please advice in this case as well.
TL;DR: It's likely that the best solution is to use npm deprecate on your old package to provide people with a message directing them to the new package name.
This issue in the npm issue tracker suggests contacting support#npmjs.com. The issue is quite old, though, and also only seems to suggest contacting support for a large number of packages. Although the issue may be out of date, if there's a better way to do things, I'm sure the support team would redirect you there.
That said, while that npm issue title asks about a redirect (implying, to me at least, automatic redirect like what you want), the answers seem to be more about "redirecting" by informing users. Chances are, that's the recommended way, for better or worse. So you can use npm deprecate on your old package to provide people with a message directing them to the new package name.

How to install/download packages without using npm install <package_name> or yarn install

I work in a banking domain company so here many link and websites are blocked. Currently I am working on a project where I am using react and Node.js as tech stack.
So whenever I want to install any new dependency or just npm install I get access problem.
Is there any other solution to download the dependencies from package.json file apart from npm install
It'll be really tough not having yarn or npm do dependency management for you but there are options.
I highly recommend you set up a private npm registry just for your company. There are many paid and free services that can do this as well as open source self-hosted solutions. Once set up, all you have to do is edit your npm or yarn configurations and you're good to go.
Here is a link with plenty of options to get this going. A few that come to mind of the top of my head are Artifactory and npm itself.
If none of these work for you, you can always just manually download npm packages from their Github repositories but this will be very tedious and time consuming (maybe you can write your custom package manager?) but I definitely don't recommend this route.

published npm package is not visible npm

I'm new to npm, recently I published an npm package 'mango-aliyan' and I can see it at https://www.npmjs.com/~shakkirptb, but https://www.npmjs.com/package/mango-aliyan is showing 404!
what am I missing here?
Thanks for your help
I've had a similar issue recently and I believe NPM does not immediately publish packages. There could be a number of reasons and I'm sure it's done on purpose.
If you wait about 5-10 minutes your package will be publically visible. I have visited the link to your package and it seems to be working just fine.

Npm download tarball failed due to broken url

I'm trying to install tileserver-gl to host my own OSM server on my windows machine.
At the moment, I have tried to install locally and via npm without much success.
The issue being, npm is unable to get 'mapbox-gl-native' from the specific web address.
I have seen similar issues to this, from this github issue thread , Link Here. In which they have provided an alternate download link.
I have tried to download the tileserver-gl files from the repo, manually put the required files inside, run npm install & npm install from source but to no avail.
There are online topics which said to use Node v4 , which i already tried on both Node v6 and Node v4 .
How do I fix this issue?

Resources