0

I see that certain versions of node, gulp etc. are incompatible with each other.

How do I know which versions are compatible with which?

1
  • C:\work\SPO\webparts\solution>gulp -v [13:06:28] CLI version 3.9.1 [13:06:28] Local version 3.9.1 C:\work\SPO\webparts\solution>node -v v10.13.0 C:\work\SPO\webparts\solution>gulp serve Build target: DEBUG [13:08:14] Using gulpfile C:\work\SPO\webparts\solution\gulpfile.js [13:08:14] Task 'serve' is not in your gulpfile Sep 29, 2021 at 12:10

2 Answers 2

1

If you're using Node.js v12+ or higher, you must use Gulp v4+.

If you're using a version of Node.js lower than v12, you must use Gulp v3.

Documentation: Set up your SharePoint Framework development environment

6
  • Hi Ganesh I have done "npm install -g gulp@latest" and when I check "gulp --version" it says CLI version: 2.3.0 Local version: 3.9.1 Sep 29, 2021 at 11:52
  • After I did the install of gulp latest it said ... [email protected] Sep 29, 2021 at 11:53
  • Do I need to run a command to make it use the 4.0.2 version of gulp? Sep 29, 2021 at 11:53
  • C:\work\SPO\webparts\solution>gulp -v [13:06:28] CLI version 3.9.1 [13:06:28] Local version 3.9.1 C:\work\SPO\webparts\solution>node -v v10.13.0 C:\work\SPO\webparts\solution>gulp serve Build target: DEBUG [13:08:14] Using gulpfile C:\work\SPO\webparts\solution\gulpfile.js [13:08:14] Task 'serve' is not in your gulpfile Sep 29, 2021 at 12:11
  • Check gulp version in package.json file in solution. Sep 29, 2021 at 12:31
2

Pete,

If you're planning on building a new solution, I'd say that Ganesh's answer is the right one; use the latest version of SPFx and Node + Gulp as per the documentation.

However, if you're trying to work with an older version of an SPFx solution, or if you're testing out a sample from https://aka.ms/spfx-webparts, you may want to refer to the compatibility matrix, which lists which version of SPFx is compatible with which version of Node, Gulp, etc.

The short URL is: https://aka.ms/spfx-matrix

Finally, if you know that you'll need to switch between versions of Node (because, maybe, you're managing multiple solutions with different versions of SPFx), I'd suggest using NVM (I use NVM for Windows).

If you haven't looked into it, I'd recommend attending the Sharing is Caring sessions, which are free sessions covering topics such as configuring your workstation, using NVM, etc.

I hope this helps?

4
  • Thanks. I did npm install -g gulp@latest --global which tells me ... + [email protected] updated 1 package in 12.317s But when I do ... C:\work\SPO\webparts\solution>gulp -v CLI version: 2.3.0 Local version: 3.9.1 Sep 29, 2021 at 13:57
  • 1
    @hugo Comp matrix is great resource. Thank you. HOwever, i dont see it mentiones Gulp version for each SPFX version? Does it matter? or latest gulp cli should work against all spfx?
    – Rohit
    Mar 27, 2023 at 17:28
  • That's a great point, @rohit. The version of Gulp depends on the version of Node -- which is controlled by the SPFx versions. Lemme see if I can update the matrix. Mar 29, 2023 at 15:32
  • umm ok... Somehow, using NVM when I switch to Old node version and execute npm install gulp yo . It always installs latest gulp, though Node is old, unless we pass gulp version parameter.
    – Rohit
    Mar 30, 2023 at 20:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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