"npm install" of a . tgz without internet connection

Asked

Viewed 101 times

0

I downloaded using "npm pack" and got the Ionic-4.0.6.tgz, now on PC without internet connection I ran the command "npm install Ionic-4.0.6.tgz" and it asks for internet connection.

Is there any way to install fully offline?

  • 1

    Look, if you’re trying to download obviously need internet....

  • Thread similar.

1 answer

1

According to the https://docs.npmjs.com/cli/install it is possible to use NPM with local packages, supported commands:

npm install (sem argumentos)
npm install [<@scope>/]<name>
npm install [<@scope>/]<name>@<tag>
npm install [<@scope>/]<name>@<version>
npm install [<@scope>/]<name>@<version range>
npm install <git-host>:<git-user>/<repo-name>
npm install <git repo url>
npm install <tarball file>
npm install <tarball url>
npm install <folder>

Your case should be npm install <tarball file>, the question is, whether he is asking for internet should be because of some dependency that package ionic-4.0.6, remember, ALL packages contain their own package.json, so it may be that a package to be installed depends on other packages.

Just for the record, ionic-4.0.6.tgz should be pointed out as absolute path or should go to the project root folder, for example:

./projeto
  ├─── ./packages.json
  ├─── ./ionic-4.0.6.tgz
  └─── ./node_modules

If so then navigate to the "project" folder (example only) with cd and then execute the command npm install ionic-4.0.6.tgz, now if the package is in another folder you should point to the absolute path, for example:

cd projeto
npm install c:\projetos\outro_projeto_de_onde_copiará_os_pacotes\ionic-4.0.6.tgz

Note that if you already have the "client" (line command) of Ionic, you don’t need to install things manually, just run one of these 3 commands:

  1. Create an empty app (I usually use this one :) ):

    ionic start <nome do projeto> blank
    
  2. Create an app with tabs:

    ionic start <nome do projeto> tabs
    
  3. Create an app with sidemenu:

    ionic start <nome do projeto> sidemenu
    

Change <nome do projeto> by the name of the folder you want to name for the project

Because usually in the global installation of Ionic (if already installed) you already have all dependencies saved in a type of cache on your computer, that is, it is likely that you need internet for this.

  • So I tried with . tgz at the root and with absolute path, both generate errors claiming not to be able to connect to the internet. I actually have nothing installed on the Ionic machine and downloaded this . tgz that contains all the dependencies

  • Dear @Mayconwsoler you read my entire reply? It may be that Ionic depends on other things, you have Ionic installed globally to use it via command line and have it cached? As far as I know this is the recommended and "official" way to use IONIC. You install it globally and never need to install it again, you can create 1000 projects from the command ionic start <nome do projeto>

  • Yes, I read the entire answer @Guilhermenascimento, the problem is exactly there, I do not have global and would like to install on this machine, bringing the file of a machine with internet access, ie. work in "offline mode". This machine I refer to does not have any access with the internet

  • @Mayconwsoler everything comes, I will see what is possible and necessary to install Ionic globally on a totally offline machine. At least you have access to flash drives right?

  • Yes, and I have Local Machine Administrator access, thank you very much!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.