Written by

Jayakumar Balasubramaniam

Share

  

Category

see all categories

How to install SPFx (Sharepoint Framework) in Linux Ubuntu?

Sharepoint Framework provides full support for client side SharePoint  development which makes the application work faster. SPFx most of the client side frameworks like Angular, Knockout, React…

SPFx supports Ubuntu platform too, in-order to work with SPFx we need nodeJS to be installed on our machine, it is also a javascript platform.

Below are the step by step instructions to install SPFx in Ubuntu,

  • Open your terminal and get the Root access to get super permission. After opening the terminal run

sudo -i

Once you hit enter it will prompt you for the password, if needed. This will give you an interactive root shell. Note that the $ at the end of your prompt has changed to a #, indicating that you have root access. From here you can run any sequence of commands as root, or run the command exit to leave the root shell.

For more info about “Sudo program” please visit this site

  • Once you are into root shell, let’s use apt package manager to install node and npm in Ubuntu machine

Let’s update package by following command apt-get update

Let’s update package by following command apt-get install nodejs

Let’s update package by following command apt-get install npm

  • Once installed run the command node -v and npm -v to make sure that your required version of node and npm are installed respectively.
  • If you want to upgrade node/npm to specific version use the below command to do that

npm install -g n

then this,

n “NodeVersionNumber”

  • Now, you need to install compiler tools by using the below command

apt-get install build-essential

  • SharePoint client-side development tools include a Yeoman generator for creating new web parts. Gulp is a bundling tool to build and bundle your typescript files.

Enter the following command to install Yeoman and gulp: npm install -g yo gulp

  • Next, the Yeoman SharePoint web part generator helps you quickly create a SPFx project with the right toolchain and project structure. Use the below command to do that

npm install -g @microsoft/generator-sharepoint

Now environment is ready to go, let’s go ahead and create first SPFx app with simple command by integrating one of the powerfull javascript framework ANGULAR 4 by following our blog “How to integrate angular 4 in SPFx(Sharepoint Framework)” 

Note: You may get in-competency error “SKIPPING OPTIONAL DEPENDENCY: Unsupported platform: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) at the time of running the command npm install to update your node_modules. Use the below command to get resolve that error

npm install –no-optional

Now you are all set to run your first SPFx app with Angular 4 in Ubuntu!! and, don’t forget to let me know if you are able to setup SPFx in Ubuntu.

Jayakumar Balasubramaniam

Written by Jayakumar Balasubramaniam

When deliverables are under the gun, Jayakumar doesn't mind burning the candle at both ends to get the job done. He takes ownership of his tasks, delivers on time and inspires the rest of the team. He loves doing what he does and no wonder he volunteers to code on his laptop even on weekends. He is a Microsoft Certified Professional (MCP), MCSA (MVC) and also actively contributes writing Technical articles to our blog.