How to Install a Package from a Download Zip File

Is it possible to install package from git repository from downloaded .zip file in npm?

Try this :

npm install ./package.zip

Reference:
https://docs.npmjs.com/cli/install

install python module using a zip file

This package is on PyPI, so all you have to do is run the following command:

pip install hazm
pip2 install hazm #Explicit python 2 selection
pip3 install hazm #Explicit python 3 selection

If you really want to use that file, you have to run the setup.py file, you can do this using the following command (assuming you are in the hazm-master folder):

python ./setup.py
python2 ./setup.py #Explicit python 2 selection
python3 ./setup.py #Explicit python 3 selection

Download package zip/tar.gz file without installing

Using download.packages:

download.packages(pkgs = "ggplot2", destdir = "/path/to/my/libs")

Or we can get the url manually using available.packages:

myPackage <- "ggplot2"
p <- available.packages()

myPackageUrl <- paste0(
p[ rownames(p) == myPackage, "Repository"], "/",
myPackage, "_",
p[ rownames(p) == myPackage, "Version"], ".tar.gz")

myPackageUrl
# [1] "https://cran.rstudio.com/src/contrib/ggplot2_2.2.1.tar.gz"

# then download
download.file(url = myPackageUrl,
destfile = paste0("/path/to/my/libs", "/",
basename(myPackageUrl)))

download a zip file via http with npm

Add this in file package.json:

  "scripts": {
"postinstall": "node download.js && <whatever you had here before>"
},
"dependencies": {
"download-file": "0.1.5"
}

And then add this in file download.js next to file package.json:

var download = require('download-file')
const url = "https://YourFileLocation";
const options = {directory: "YourDirName", filename: "YourFileName"};
console.log("Installing " + options.directory + "/" + options.filename);
download(url, options, function(error) {if (error) throw error;});

See: https://www.npmjs.com/package/download-file

How to use Python's pip to download and keep the zipped files for a package?

pip install --download is deprecated. Starting from version 8.0.0 you should use pip download command:

 pip download <package-name>


Related Topics



Leave a reply



Submit