4

I am unable to setup SPFx Development Environment for my SharePoint Online. I installed 10.24 and 10.20 version of Nodejs then also installed gulp and yeoman. But when I execute yo @microsoft/sharepoint command, the nodejs command prompt throws error as shown in below picture. I tried multiple times to uninstall and reinstall 10.x versions of nodejs but the error is same. I am not able to find any information about this error on google.

TypeError: lookup.flatMap is not a function

enter image description here

1
  • Hi Zakir, Can you please run the following command "npm list -g --depth=0" and post screen shot here. Apr 25 at 9:52
6

This is the issue related to yeoman. You can fix this issue by downgrading it from 4.0.0 to 3.1.1

npm install yo@3.1.1 -g

This combination does not work

  • @microsoft/generator-sharepoint@1.11.0
  • gulp@4.0.2
  • npm@6.14.11
  • yo@4.0.0

This combination works

  • @microsoft/generator-sharepoint@1.11.0
  • gulp@4.0.2
  • npm@6.14.11
  • yo@3.1.1

Similar question was asked here.

1
  • 1
    Thanks a ton Denis. Your solution worked perfectly. The issue was related to yeoman version.
    – Zakir HC
    Apr 25 at 14:29
1

I am assuming that you have installed only one version of nodejs at a time. For SPFx generator SharePoint online you will require v10.24.0 of nodejs.

Open command prompt and run following command in CMD to check global version of package

npm list -g --depth=0

Ideally it should display following following version

+-- @microsoft/generator-sharepoint@1.11.0

+-- gulp@4.0.2

+-- npm@6.14.11

-- yo@3.1.1

If you have multiple version of nodejs without using nvm then it will not work.

For more details you can refer the this Microsoft docs.

Set up your SharePoint Framework development environment

3
  • Yes @Rajat Sahani, one can only install one version of npm at a time. I had installed 10.20 and 10.24 nodejs version at one time. I have npm installed and its upto the lastest version.
    – Zakir HC
    Apr 25 at 11:53
  • have you unistall old one before intalling new one? Apr 25 at 11:59
  • Yes I did that.
    – Zakir HC
    Apr 25 at 12:06

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.