Monday 17 June 2019

SharePoint SPFx Setup Without Administrative Rights

SPFx Setup


Requirements:


  1. NodeJS package installed on your machine
  2. Code editor such as Visual Studio Code

These are freeware and can be downloaded from the web and installed locally.

SPFx Setup for Windows (With Administrator Access):

To simplify the entire setup process (if you do have administrator access on your machine), it can be broken down into 3 simple steps:

  1. Download NodeJS MSI installer and execute the installer as administrator
    • You can download the NodeJS installer from: https://nodejs.org/en/
    • After the download completes, execute the MSI file. Generally, this would install all the necessary files, register the node command in the global variables and download all required files in the Program Files/NodeJS folder.
  2. Download and install Visual Studio Code
    • You can download Visual Studio Code from: https://code.visualstudio.com/
    • Run the exe file to install Visual Studio Code
      Please note: You can use any other code editor you are comfortable with – Atom, Webstorm etc.
  3. Install the necessary tools for development – Yeoman, Gulp and SharePoint Generator, you would use the following commands from Command Prompt:
    • Globally install Gulp and Yeoman –
      npm install -g yo gulp
    • Globally install SharePoint Generator –
      npm install -g @microsoft/generator-sharepoint
    • These commands would need to download files from the internet and install them locally, if you are behind a corporate proxy, you would need to set the proxy in the npm config files using the following commands:
      npm config set proxy [Your Proxy URL]
      npm config set https-proxy [Your Proxy URL]

SPFx Setup for Windows (Without Administrator Access on local machine):

In some cases, it would be possible that users do not have administrator access on their local machines, which would prevent them from running NodeJS installation. Below are the steps for setting up your development environment for SPFx, without administrative privileges:

  1. Download the NodeJS zip folder for version 8.x and extract files locally
    • You can download the NodeJS zip for version 8.x from: https://nodejs.org/dist/latest-v8.x/
    • Copy the zip folder to a dedicated local location and extract all files. You will have a folder with the Node version as node-v8.x… This folder will contain the node.exe application
    • Copy the path to the of the node.exe file and add it to the local environment variables of your machine.
      Please note: The local environment variables would allow you to execute the node.exe commands from any location of your machine, however, local environment variables work on a per user basis and would need to be installed for each user separately
  2. Download and install Visual Studio Code
    • You can download Visual Studio Code from: https://code.visualstudio.com/
    • Run the exe file to install Visual Studio Code
      Please note: Visual Studio Code installation would not need Administrator privileges.
  3. Install the necessary tools for development – Yeoman, Gulp and SharePoint Generator. Start Command Prompt and navigate to the folder where you would create your SPFx solution. You would use the following commands from Command Prompt:
    • Install Gulp and Yeoman locally –
      npm install yo gulp
    • Install SharePoint Generator locally –
      npm install @microsoft/generator-sharepoint
    • These commands would need to download files from the internet and install them locally, if you are behind a corporate proxy, you would need to set the proxy in the npm config files using the following commands:
      npm config set proxy [Your Proxy URL]
      npm config set https-proxy [Your Proxy URL]

      Please note: The commands used here would add all the necessary node modules to the defined folder only. Referencing those modules outside the scope of that folder would not be possible
A significant portion of this blog is referred from: Set up your SharePoint Framework development environment

However, I have tried to rephrase and simplify the information to my best ability.


No comments:

Post a Comment