Npm download tarball failed due to broken url - node.js

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?

Related

How to install just node modules without internet

There is a way to install npm package to a machine which doesn't have internet acccess is, using npm pack in machine with internet acces, copying it to machine without internet and running npm install <tar> in it. But npm pack, packs whole project.
But I want to manage and install the modules myself, without the opportunity for the developers to add/remove any modules. So I just want node_modules to be packaged. And then want to install it to machine without internet.
For example when developer push his/her commits to origin, I want to get node_modules from ftp etc. and codes from GitLab then go on continuous integration with this static node_modules.
How can I do that?
There is a solution to manage the modules yourself: you can store your node_modules in its own repo in which your developers will only be able to clone/get the repo and not contribute/modify it.
Hope this helped you
This can be done, please look at Installing a local module using npm? . You can FTP or whatever to get the packages and install them using npm.

Create an offline installer of npm package

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.

How to manage npm install in a system without internet connection

I am facing challenges while creating package for all the clientside components of my project in a system which does not have internet connection (for windows).
I have installed NPM for windows in the system. I need to manage the node_modules and run gulp commands in the system to create the package.
Since there is no internet connection in the box, I decided to copy the node_modules from my local box to the box which does not have internet connection.
For copy task, I am using msbuild script but somehow it is not working for me. Also, I see that when I am trying to copy the node_modules manual from one folder to another folder I am unable to copy.
Installed Node version : v0.12.2
NPM version: 2.7.4
Can anyone help me to provide any working sample to fix the above problem.
I think your approach is generally sound. You can build on the internet connected computer no problem! Copy files over with a usb stick if you like.
Here are some tips that might help solve your problems.
If the box is offline, develop on your local machine and deploy to the box
If possible do the gulp steps also on your local machine
Otherwise you need to run the local directory install of gulp. e.g.
node node_modules\gulp\bin\gulp.js build
because you won't be able to npm install -g gulp
Point 3 will work for other global npm_modules too btw
If you are facing long paths (> 256 characters) which can cause copy problems
Try using npm dedupe to remove duplicates
Or try copying to a shorter path e.g to c:\proj instead of to c:\very\long\path\proj
Or explicity install a dependency which has a long path
e.g
npm install deepdep#1.2.4
and then prune that folder from the original
rm node_modules\package\node_modules\package_with_too_many_nested_folders
Or Install the latest npm (v3.0 or higher) which solves this issue once and for all
e.g. npm install -g npm
which will build a much flatter hierarchy for your packages. Requires removing and reinstalling all packages.
Point 5 is a notorious issue on windows which is not a problem on linux because paths can be extremely long. (unless you are mounting a windows a windows directory from linux)
Personally I would go straight for the latest npm version but you have a number of ways of getting around the issue if this is not possible.

How to use latest npm on Azure Mobile Service deployment

The Azure Mobile Service image that I am using currently is locked down to npm version 1.2.30. There are latest npm version installed on the image(under ...\Program Files(x86)\npm). But npm is locked down to the version 1.2.30 due to the reason that it was installed with node.js(under ...\Program Files(x86)\nodejs) AND the path always looks under \nodejs\ folder first and uses it.
This is causing me problem in using some npm packages (including googleapis) on deployment. The errors appear while installing googleapis are bugs in older version of npm and are resolved in latest.
The simplest solution is to delete the 'npm' file and 'npm.cmd' file under ...\Program Files(x86)\nodejs\ folder so that the npm is read from ..\Program Files(x86)\npm\ folder. But i get access denied errors while trying to access these files. I am accessing the mobile service image through Kudu interface.
Is there are work-around for this?
For upgrading npm, you can follow the instructions from David Ebbo on this forum post: https://social.msdn.microsoft.com/Forums/azure/en-US/068ef026-f80d-4bf8-9f40-5d1af33a1024/git-deployment-fails-with-npm-error-when-resolving-a-package-version-containing-a-?forum=windowsazurewebsitespreview

meteor deploy npm packages

I use multiple npm packages in my meteor application, for instance the 'knox' package for amazon s3 access.
On my local system I don't have any problems, because I have the 'knox'- npm package installed on my system. But on the server this is obviously not the case.
I have read different suggestions what I could do:
1)
Install the npm module into the /public folder of my application
- unfortunately I don't know how to do that.
2)
I followed this tutorial:
NPM Deploy Tutorial
I created packages/knox/package.js packages/knox/knox.js and I am pretty sure I did everything as described in the tutorial but this is not even working locally
Use npm package from Atmosphere. See details on how to use it.
Did you remember to add the knox package to the .meteor/packages file?
The link you shared is pre Meteor 0.6.5, which loaded all packages in packages/ automatically. Now, you need to specify them individually.

Resources