Skip to main content

Getting started with SharePoint Framework (SPFx) setup from Beginning

How to Set Up SharePoint Framework (SPFx) for Beginners

How to Set Up SharePoint Framework (SPFx) for Beginners

Author: Vishal Thakur

Introduction

SharePoint is a framework used to implement web applications, primarily for internal organizational purposes like document sharing, collaboration, and other activities. If you're a beginner looking to learn SharePoint Online and its latest framework, SPFx, you're in the right place. In this blog, we'll walk you through the setup process.

Steps to Set Up SharePoint Framework

Setting up the SharePoint Framework is as easy as baking a pancake. You just need to run a few commands in the Node.js command prompt, and you'll be ready to build your first web part.

1. Install Node.js

Node.js is an open-source, cross-platform, back-end JavaScript runtime environment. For SPFx development, install Node.js version 10.16.1 from the official Node.js website.

Node.js Installation

Once installed, open the Node.js command prompt and run the following commands:

2. Install Gulp

Gulp is a JavaScript toolkit used as a streaming build system in front-end web development. Install it globally using the following command:

npm install -g gulp
Gulp Installation

3. Install TypeScript

TypeScript is a programming language developed by Microsoft. It adds optional static typing to JavaScript and is designed for large applications. Install it globally using:

npm install -g typescript

4. Install Yeoman

Yeoman is a scaffolding tool for web applications. It helps generate SPFx solutions. Install Yeoman and the SharePoint generator using:

npm install -g yo
npm install -g @microsoft/generator-sharepoint
Yeoman Installation

5. Create Your First SPFx Solution

Open Visual Studio Code and run the following command to create a new SPFx solution:

yo @microsoft/sharepoint

Follow the prompts to name your solution (e.g., "Hello Galaxy") and select ReactJS as the framework.

6. Build and Serve Your Solution

After creating the solution, run the following commands to build and serve your project:

gulp trust-dev-cert
gulp build
gulp serve

If you encounter execution policy issues, add the following line to your settings.json file in Visual Studio Code:

"terminal.integrated.shellArgs.windows": ["-ExecutionPolicy", "Bypass"]

Conclusion

Setting up the SharePoint Framework is straightforward. After running gulp serve, your local workbench will open, allowing you to test your web part. For more advanced topics, check out our guide on implementing a carousel with ReactJS and SPFx.

We hope this guide helps you get started with SPFx. Please share your comments and suggestions below!

Thanks for reading!

Comments

Post a Comment

Popular posts from this blog

Power Apps modern driven app Interview Question and answer

Power Apps Modern Driven App: Questions and Answers Power Apps Modern Driven App: Questions and Answers Power Apps modern driven apps are low-code/no-code platforms that enable users to create custom applications. Below are some common questions and detailed answers to help you understand their capabilities and applications. Question 1: What is a Power Apps modern driven app? Answer: A Power Apps modern driven app is a low-code/no-code application development platform provided by Microsoft. It allows users to create custom applications that can run on various devices and platforms without extensive coding. These apps are built using a visual interface and can integrate with different data sources. Question 2: What are the key components of a Power Apps modern driven app? Answer: The key components of a Power Apps modern driven app are: Screens: Serve as the user interface for the app, including layouts, ...

SPFX Interview question for 2023

SPFx Interview Questions for 2023 SPFx Interview Questions for 2023 Author: Vishal Thakur Question 1: What is SharePoint Framework (SPFx)? Answer: SharePoint Framework (SPFx) is a development model introduced by Microsoft for creating client-side web parts and extensions for SharePoint Online and SharePoint 2019. It is based on modern web technologies like JavaScript, TypeScript, and React, providing a rich and responsive user experience. Question 2: What are the key advantages of using SPFx for SharePoint development? Answer: SPFx offers several advantages, such as: Responsive and mobile-ready web parts and extensions. Seamless integration with SharePoint data and services. Support for modern web development practices and tools. Easy deployment and hosting options. Enhanced security and isolation through the SharePoint app model. Question 3: Can you explain ...

Create self signed SSL certificate

How to Create a Self-Signed SSL Certificate for React JS Using mkcert How to Create a Self-Signed SSL Certificate for React JS Using mkcert A self-signed certificate is a digital certificate that is created and signed by the same entity it identifies. Unlike certificates issued by trusted Certificate Authorities (CAs), self-signed certificates aren't verified by external parties. They're commonly used for local development, testing, or internal systems where the identity verification provided by a CA is not necessary. Although self-signed certificates can secure communication, they lack the third-party validation provided by CA-signed certificates, and users may encounter browser warnings when accessing websites using self-signed certificates. In this guide, we’ll walk you through the steps to create a self-signed SSL certificate for your React JS application using mkcert . Step 1: Install Chocolatey ...