This repository has been archived by the owner. It is now read-only.

How can I install packages with all dependencies offline? #1349

Closed
ericfong opened this Issue Sep 3, 2011 · 13 comments

Comments

Projects
None yet
9 participants
@ericfong

ericfong commented Sep 3, 2011

Would like to package up node.js, npm and npm packages like forever, express, formidable in to a tar.
And transfer it to different machine which don't have internet access.
Then run a install script to compile and install all node and npm packages.

I made the node and npm core packed. But I can't find any way to pack express or forever which have a lot of dependencies and some dependencies need to be build in the target machine.

Thanks

@isaacs

This comment has been minimized.

Show comment
Hide comment
@isaacs

isaacs Oct 3, 2011

Member

List the dependencies in bundledDependencies in your package.json, and then run npm pack to create a tarball. Get that over to the other machine, adn either npm install <tarball>, or just crack it open manually.

Member

isaacs commented Oct 3, 2011

List the dependencies in bundledDependencies in your package.json, and then run npm pack to create a tarball. Get that over to the other machine, adn either npm install <tarball>, or just crack it open manually.

@isaacs isaacs closed this Oct 3, 2011

@msgforashish

This comment has been minimized.

Show comment
Hide comment
@msgforashish

msgforashish Aug 15, 2012

Hi isaacs,

Can you please elaborate more on the "bundeledDependencies" thing. I have to install the forever package on a server which do not have an internet access.
I created a tar ball for forever but it needs lot of other dependencies. How can I find out what all dependencies and sub dependencies it needs.

Thanks in advance!

msgforashish commented Aug 15, 2012

Hi isaacs,

Can you please elaborate more on the "bundeledDependencies" thing. I have to install the forever package on a server which do not have an internet access.
I created a tar ball for forever but it needs lot of other dependencies. How can I find out what all dependencies and sub dependencies it needs.

Thanks in advance!

@opichals

This comment has been minimized.

Show comment
Hide comment
@opichals

opichals commented Nov 15, 2012

You could try this #1738 (comment)

@kenberkeley

This comment has been minimized.

Show comment
Hide comment
@kenberkeley

kenberkeley Apr 15, 2016

  1. In online environment, npm install --no-bin-link. You will have a entire flattened node_modules
  2. Then, bundle this flawless node_modules with tar / zip / rar / 7z etc
  3. In offline environment, extract the bundle, that's it

P.S node-pac is another option, but it can't deal with the packages which still need downloading something for installation.

kenberkeley commented Apr 15, 2016

  1. In online environment, npm install --no-bin-link. You will have a entire flattened node_modules
  2. Then, bundle this flawless node_modules with tar / zip / rar / 7z etc
  3. In offline environment, extract the bundle, that's it

P.S node-pac is another option, but it can't deal with the packages which still need downloading something for installation.

@TimothyWrightSoftware

This comment has been minimized.

Show comment
Hide comment
@TimothyWrightSoftware

TimothyWrightSoftware Jul 16, 2016

The problem I'm having is this doesn't seem to work with command line tools like typescript. I tried the pack method, local install, --no-bin-link, the recursive dependencies are never pulled down.

TimothyWrightSoftware commented Jul 16, 2016

The problem I'm having is this doesn't seem to work with command line tools like typescript. I tried the pack method, local install, --no-bin-link, the recursive dependencies are never pulled down.

@kenberkeley

This comment has been minimized.

Show comment
Hide comment
@kenberkeley

kenberkeley Jul 17, 2016

@TimothyWrightSoftware
Update node and npm
node >= 5
npm >= 3

kenberkeley commented Jul 17, 2016

@TimothyWrightSoftware
Update node and npm
node >= 5
npm >= 3

@TimothyWrightSoftware

This comment has been minimized.

Show comment
Hide comment
@TimothyWrightSoftware

TimothyWrightSoftware Jul 17, 2016

Do the newer versions with --no-bin-link just work? Or is there more to it than just using the latest version?

TimothyWrightSoftware commented Jul 17, 2016

Do the newer versions with --no-bin-link just work? Or is there more to it than just using the latest version?

@kenberkeley

This comment has been minimized.

Show comment
Hide comment
@kenberkeley

kenberkeley Jul 18, 2016

@TimothyWrightSoftware npm3 could resolve and flatten those dependencies

kenberkeley commented Jul 18, 2016

@TimothyWrightSoftware npm3 could resolve and flatten those dependencies

@bala-infiswift

This comment has been minimized.

Show comment
Hide comment
@bala-infiswift

bala-infiswift Jun 30, 2017

How to install npm latest in linux without internet connection ?

bala-infiswift commented Jun 30, 2017

How to install npm latest in linux without internet connection ?

@kenberkeley

This comment has been minimized.

Show comment
Hide comment
@kenberkeley

kenberkeley commented Jun 30, 2017

@bala-infiswift how about U-disk?

@bala-infiswift

This comment has been minimized.

Show comment
Hide comment
@bala-infiswift

bala-infiswift Jun 30, 2017

bala-infiswift commented Jun 30, 2017

@legenddcr

This comment has been minimized.

Show comment
Hide comment
@legenddcr

legenddcr Sep 5, 2017

Seems npm pack cannot work with scoped package:
#17708

legenddcr commented Sep 5, 2017

Seems npm pack cannot work with scoped package:
#17708

@jingsong-liu

This comment has been minimized.

Show comment
Hide comment
@jingsong-liu

jingsong-liu Nov 1, 2017

Download the install package and install it manually.

jingsong-liu commented Nov 1, 2017

Download the install package and install it manually.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.