How to install angular-cli without internet

后端 未结 3 1598
花落未央
花落未央 2021-02-05 13:58

If you only have the zip file to install angular-cli with - how can it be installed without an internet connection?

3条回答
  •  别跟我提以往
    2021-02-05 14:54

    ----online machine-----

    1. Install node by using the executable files downloaded from the official node website.
    2. Install the @angular/cli globally on the on-line machine.
    3. Check the C:\Users\Admin\AppData\Roaming folder.
    4. Zip the npm and npm_cache folder.
    5. Transfer the above zip file and node executable to the offline machine.
    6. Create the new project in angular
    7. zip the node_module folder inside the created project and transfer it to the offline machine.

    ----Offline Machine------

    1. Install node from its executable
    2. Unzip the npm and npm_cache folder and move it to the C:\Users\Admin\AppData\Roaming folder.
    3. Run the following command to install the @angular/cli and its dependencies
    npm i @angular/cli -g --cache MY_CACHE_FOLDER --cache-min 999999999 --no-shrinkwrap
    
    1. Now create the new angular project. It will show some errors but don't worry.
    2. Unzip and move the node_module folder inside the new project.
    3. Now, you can work/run on the project as usual.

提交回复
热议问题