1

I am getting the following error when trying to use yo @microsoft/sharepoint

Error @microsoft/sharepoint

This generator (@microsoft/sharepoint:app) requires yeoman-environment at least 3.0.0, current version is 2.10.3, try reinstalling latest version of 'yo' or use '--ignore-version-check' option

I have reinstalled the lastest version and can see that the current and wanted version matches when I use the command npm -g outdated.

3 Answers 3

1

I've got the same error, but in fact it seemed it came from the version of the generator-sharepoint that was not compatible.

try this :

npm uninstall -g @microsoft/generator-sharepoint

then install a previous version :

npm install -g @microsoft/[email protected]

I put here the version I have to be able to create spfx solution (because I had a looot of trouble finding stuff that work together) :

Yo --version > 3.1.1

node -v > 10.24.0 (avoid 12 at all cost)

tsc -v > 4.0.5

note : to check your version of generator :

npm ls -g --depth=0 @microsoft/generator-sharepoint

Hope it will help

0

Looks like your yeoman package is outdated. Try the following command to get the latest version:

npm install [email protected] -g

Update

As of today, yeoman v4 is not compatible with the SPFx generator. this is why we install v3.

4
  • I get TypeError: lookups.flatMap is not a function" error when using yo @microsoft/sharepoint once i update it
    – hellothere
    Commented Nov 2, 2021 at 10:19
  • updated the answer. I forgot that yo v4 causes this issue. Try installing v3. It will fix it. Commented Nov 2, 2021 at 11:31
  • 1
    Hi @denis-molodtsov, thank you for your help. I tried it but it just wouldn't work so I decided to just uninstall everything and reinstall it following the steps here docs.microsoft.com/en-us/sharepoint/dev/spfx/…
    – hellothere
    Commented Nov 2, 2021 at 12:26
  • Good point. Perhaps, you also had other issues. For example, with the wrong node.js version Commented Nov 2, 2021 at 13:13
0

check your version list---

  • npm ls -g --depth=0

try this :

  1. npm uninstall -g @microsoft/generator-sharepoint

then install a previous version :

  1. npm install -g @microsoft/[email protected]

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.