How to install npm package while battery life?

I work on a standalone network and want to install angular-cli using npm. I have an angular-cli zip file and use the latest version of node and npm. I use the command: npm install ./angular-cli-masterto install angular-cli from a folder. But I keep getting this error telling me that I don't have an internet connection (which is normal). So how do you install this angular-cli offline using the zip archive downloaded from Github?

Thanks for your help.

+29
source share
4 answers

You simply copy the package and all the dependencies in your folder node_modulesinside the project for local installation or in the global folder ( npm config get prefixto see where it is located) for global installation.

The behavior npm installis to check the dependencies and install them first. When he does not find them installed or the local file containing them, he tries to download them.

Since all these steps do not work (you do not have the installed dependency, it is not available at the expected location and cannot download it), the installation fails.

You can find the list of dependencies in package.jsoneach module, but since it is recursive, it may take a long time for everything to be correct, if you do it manually, npm does it by recursion.

npm install angular-cli, .

+21

2016 - Addy Osmani npm

2017 - npm 5 --prefer-offline npm install

yarn .

+18

, . NPM, @angular/cli, , , npm install

cli .

+3

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

, , , , , : npm install/angular -cli-master (= , zip ) zip , : npm install./angular-cli-master.tgz
(= zip , , .zip - , )

0

Source: https://habr.com/ru/post/1016098/


All Articles