• Desktop Build of An Node Application

    Posted by Neha Yadav | Last Updated: 07-Jan-19


    This article covers any application written in NodeJs as backend and angular 5 as frontend.

    We can make desktop build of an application but before that, we need some prerequisites in a system in which we are about to make the build.

    Following are the steps to make the build:-

    Step 1:- Node Package Manager(npm) and NodeJs should be installed in the system. ( for all three Linux/windows/mac)

    curl -sL | sudo -E bash -
    sudo apt-get install -y nodejs

    check the npm version

    npm -v

    check the node version

    node -v

     Step 2:- Install angular 5 in the system. ( for all three linux/mac/windows)

    i) first install typescript:-

    sudo npm install -g typescript

    ii) then angular

    npm install -g @angular/cli

    iii) check the angular version

    ng -v

    Step 3:- Test your application on local host whether its running or not

    ng serve -o

    Step 4:- If the program runs successfully then make a build of your application

    ng build

    Step 5:- Install electron-package globally. This package is responsible for making the desktop build. We have to install it in our system to make it.

    npm install electron-packager -g

    Step 6:- Finally make desktop build by using this command

    i) windows

    electron-packager ./ ApplicationName --platform=win32 --arch=x64

    ii) Linux

    electron-packager ./ ApplicationName --platform=linux --arch=x64

    iii) mac/IOS

    electron-packager ./ ApplicationName --platform=darwin --arch=x64

    Step 7:- If the build was successful then a folder will be created by application name

    cd ./ApplicationName

    Step 8:- Run the application

    Double click on the application icon. And application will be run on the desktop.




Tags: nodejs