Skip to content

Setup your machine

Chakkaradeep (Chaks) CC edited this page Aug 18, 2016 · 21 revisions

The SharePoint Framework is currently in Preview, and is subject to change based on customer feedback. While we’re in preview, SharePoint Framework web parts are not supported for use in production environments.

In order to successfully complete the tutorials, you will need to setup your Mac or PC with the right tools.

Mac or PC

You can use a Mac or PC to complete the tutorials.

Install Dev Tools

  • NodeJS Long Term Support (LTS) version

    • If you have NodeJS already installed please check you have the latest version using node -v. It should return the current LTS version.
    • If you are using a Mac, it is recommended you use homebrew to install and manage NodeJS.
  • Visual Studio Code

If you are running on a PC, you need to install a couple more things - Visual Studio and Python.

Here are some tools that might come in handy as well.

Install Yeoman and Gulp

Now that you have setup your dev environment, it is time to install Yeoman. Yeoman helps you to kick start new projects, prescribing best practices and tools to help you stay productive.

SharePoint client-side development tools includes a yeoman generator for creating new webparts and reference:

  • Common build tools
  • Common boilerplate code to help build webparts (base libraries)
  • Common playground web site to host their webparts for testing purposes

Use the following console command to install Yeoman and Gulp:

npm i -g yo gulp

Install Yeoman SharePoint Generator

The Yeoman SharePoint WebPart generator lets you to quickly create a SharePoint client-side solution projects with the right tool chain and project structure.

Use the following console command to install SharePoint generator:

npm i -g @microsoft/generator-sharepoint 

Known issues

node-gyp rebuild error:

You may get the following error when you do yo @microsoft/sharepoint

> [email protected] install C:\Users\chakkaradeep\apps\helloworld-webpart\node_modules\bufferutil
> node-gyp rebuild

MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "4.0".

While the console reports an error, it is safe to ignore this error. The dependency bufferutil tries to use MSBUILD to compile their tools and if not available, it uses its JavaScript tool instead, though it gives you an error.

Phantomjs error

In Windows, you may get the following error:

Failed at the [email protected] install script 'node install.js'.

This is because phantomjs is not able to find python to run the script. To fix this issue, you will need to add python directory to the PATH system environment variable and then close and reopen a new console session.

Next steps

You are all set now to build SharePoint client-side solutions!

Clone this wiki locally