Useful Commands for SharePoint Framework (SPFx) Development using Node.js Command Prompt

Introduction

 
These are a few commands which are very useful when developing the SharePoint framework(Spfx) web part. It requires the installation of several components, including jQuery, Bootstrap, Datatable, Gulp, PnP js, jquery UI, Yeoman, etc.  
 

Commands

 
Install Yeoman and gulp
 
npm install -g yo gulp
 
To check the version of the Yeoman
 
yo –version
gulp –v 
 
Install jQuery
 
Npm install jquery -save
Npm install @types/jquery --save
 
Install bootstrap
 
npm install bootstrap –save
npm install @types/bootstrap –save
 
Install data table
 
npm install datatables.net –save
npm install @types/datatables.net --save
 
Build the solution
 
Gulp bundle
 
Create a package of the solution
 
Gulp package-solution
 
Run the solution
 
Gulp serve
 
Open the solution in the code editor of your choice
 
Code. 
 
Install the SharePoint Framework Yeoman generator globally
 
npm install -g @microsoft/generator-sharepoint
 
Trust the certificate
 
gulp trust-dev-cert
 
Install SPFx controls react controls
 
npm install @pnp/spfx-controls-react --save --save-exact
 
Install PnP components
 
npm install node-pnp-js –save
 
Install jQueryUI
 
npm install @types/jqueryui –save
 
To kill the node process that is running the live server with Gulp
 
taskkill /f /im node.exe