Setting up SPFX Environment and Tooling
June 01, 2020 -1 min read
SPFX Development environment Set up(Windows)
Chocolaltey
- First, ensure that you are using an administrative shell - you can also install as a non-admin, check out Non-Administrative Installation.
- https://chocolatey.org/docs/installation
nodejs
nvm
- nvm is a version manager for node.js, designed to be installed per-user, and invoked per-shell. nvm works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash), in particular on these platforms: unix, macOS, and windows WSL.
- https://github.com/nvm-sh/nvm#installing-and-updating
- Item 3b
yarn
- Both NPM and Yarn are both package managers. They created Yarn to solve the problems they were having while using NPM particularly the problems with consistency, security and speed. Yarn has the same feature set while operating faster, more securely and most importantly more reliable.
- Faster build process
- can run multiple versions of packages.
Install Python
Updating environmental variables if required
- https://www.python.org/downloads/
- C:\Python27
- C:\Python27\scripts
- C:\users\appData\Roaming\nvm
- C:\Program files\nodejs
Windows Terminal
- The Windows Terminal is a modern, fast, efficient, powerful, and productive terminal application for users of command-line tools and shells like Command Prompt, PowerShell, and WSL. Its main features include multiple tabs, panes, Unicode and UTF-8 character support, a GPU accelerated text rendering engine, and custom themes, styles, and configurations.
- https://github.com/microsoft/terminal
Visual Studio Code
- Free. Built on open source. Runs everywhere.
- https://code.visualstudio.com/
Extensions
- ESLint
- Git Lens
- TSLint
- Git History
- Debugger for Chrome
- Git Blame
- Prettier
- Auto Import
- vscode-icons
- Spell Checker
- markdownlint
- bracket pair colozier
Finally SharePoint Framework
- Follow the instructions for SPFX set up
- Commands
Install Yeoman and Gulp
yarn gobal add gulp yo @microsoft/generator-sharepoint
PnP SPFX Generator
yarn global add @pnp/generator-spfx
Trusting SPFX - Local Workbench setup
gulp trust-dev-cert
You are all set to run your First SPFX webpart