"npm install" from a .tgz without internet connection

0

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

Is there a way to completely install offline?

    
asked by anonymous 13.08.2018 / 15:15

1 answer

1

According to the link it is possible to use NPM with local packages, commands supported:

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, if it's asking for internet should it be because of some dependency that the ionic-4.0.6 package, remember, ALL packets contain your own package.json so it may be that a package to be installed depends on other packages.

Just to note, ionic-4.0.6.tgz should be pointed as absolute path or should go in the root folder of the project, 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 run the command npm install ionic-4.0.6.tgz , now if the package is in another folder you should point the absolute path, for example: / p>

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

Note that if you already have Ionic's "client" (command line), you do not need to install things manually, just run one of these 3 commands:

  • Create an empty app (I usually use this :) ):

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

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

    ionic start <nome do projeto> sidemenu
    
  •   

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

    Well, generally in the global installation of ionic (if you have already installed) you already have all dependencies saved in one type of cache on your computer, that is, you probably need the internet for this.

        
    13.08.2018 / 15:28