Written by

Jayakumar Balasubramaniam

Share

  

Category

see all categories
intranet as a service

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

In this article we are going to see how to setup SharePoint Framework environment in Linux Ubuntu. SharePoint Framework is an emerging technology in SharePoint world. It is a page and web part model that provides full support for client-side SharePoint development. Please have a look at the overview of SharePoint Framework in the official Microsoft documentation.

Get Root access in Linux

We need some elevated permissions to do the proper setup for SPFx. Open your terminal and get the Root access to get super permission by running the following command in the terminal.

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 been 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 RootSudo. Once you are logged in to root shell follow below steps to install required tools to run SPFx.

Tools to be installed

To work with SPFx we need following set of tools to be installed in Linux machine.

1. Node JS follow this link, else you can install the nodejs by using below command

apt-get install nodejs

2. Install node package manager by using below command,

apt-get install npm

 3. Install compiler tools by using the below command,

apt-get install build-essential

 4. 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. Use the below command to install Yeoman generator and gulp

npm install -g yo gulp

5.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

 6. Make sure to install any of the IDE to develop SPFx Webparts/Extensions some of them are listed below,

Visual Studio Code

Atom.

Verifying the Version:

Once you have installed above tools run the below commands to make sure that your required version of node and npm are installed respectively.

node -v

npm -v

Previously, SharePoint Framework will work with Node version 6.10.4 only now it will work the node versions up to 8.11.2, this update was announced in SharePoint conference 2018.

If you want to upgrade node to specific version use the below command to do that

npm install -g n

then this,

n “NodeVersionNumber”

Expected issues:

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

Finally, we have installed all the tools and ready to create first SharePoint framework webpart in Ubuntu with simple commands by integrating one of the powerfull javascript framework ANGULAR 4 by following my article “How to Integrate SharePoint Framework-SPFx Apps With Angular

 If you have any questions/issues about this article, please let me know in comments.

 

Jayakumar Balasubramaniam

Written by Jayakumar Balasubramaniam

A technology evangelist working on Microsoft 365, SharePoint & Azure. Gets my hands dirty with latest and greatest of SharePoint, Azure & front-end frameworks. Currently working with “Hubfly – A unified digital workplace” as a Product Engineer. Getting in to the depth of the domain & technology, with my eyes for perfection, ensures that the product releases go right every time.