3

when I run gulp serve I get the following error.

Your dev environment is running NodeJS version v10.15.0 which does not meet the requirements for running this tool. This tool requires a version of NodeJS that matches >=8.9.4 <9.0.0

My current version of

 - Node is 10.15
 - Gulp is 3.9
 - @Microsoft/sp-core-library -1.7.1

I followed this article but it works only for Microsoft framework 1.2.0 but it does not work for Microsoft framework 1.6.0 or Microsoft 1.7.1

When I follow the above article I can run gulp serve but I cannot include the

import { AadHttpClient, HttpClientResponse } from '@microsoft/sp-http';

as it is only supported in spfx framework 1.6 and above.

Is there a way to get the workbench working.

  • Which version of SharePoint Framework do you use? – Sergei Sergeev Jan 16 at 17:35
  • Thank you for the reply. The SharePoint framework is 1.7.1 – user1339913 Jan 16 at 17:39
  • are you using the following command to serve npx -p node@8 gulp serve ? (notice the number 8) – baywet Jan 16 at 19:14
1

You can use nvm (node version manager) to quickly switch between different nodejs versions. Download for windows or OSX version.

How to use

  1. Install nvm
  2. $ nvm install 8.11.0 - installs nodejs version 8.11.0
  3. $ nvm use 8.11.0 - now your system uses 8.11 version of nodejs. With that version you can run gulp serve without issues.
  • Thank you so much for the answer. You are a life saver. Should we avoid node v10.15 completely for now. – user1339913 Jan 16 at 23:46
  • Well, for SharePoint Framework projects yes, you should avoid, but for everything else, it's totally fine. Actually I've created a tool, which fixes SPFx project and allows you to use nodejs 10.x - the link. It's not official, but I use it and it works good. – Sergei Sergeev Jan 17 at 5:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.