Skip to content

Yeoman generator unable to use older version of @microsoft/sharepoint #10268

@harrybbdev

Description

@harrybbdev

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

None

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

No response

Describe the bug / error

I need to install version 1.20.0 of SPFx, as a package that I am working with does not work on the later versions of Node, which 1.21.0 uses.

I have tried every combination of:

  • npm install -g @microsoft/generator-sharepoint@1.20
  • npx -p @microsoft/generator-sharepoint@1.20 yo @microsoft/sharepoint
  • yo @microsoft/sharepoint@1.20.0
  • Cleaned my global cache, uninstalled everything and installed 1.20.0 again globally

For all of these, I am met with the following screen, clearing showing 1.21.1 being used.

     _-----_     ╭──────────────────────────╮
    |       |    │ Welcome to the Microsoft │
    |--(o)--|    │      365 SPFx Yeoman     │
   `---------´   │     Generator@1.21.1     │
    ( _´U`_ )    ╰──────────────────────────╯
    /___A___\   /
     |  ~  |
   __'.___.'__
 ´   `  |° ´ Y `

Workaround
The only way it works fully is via this command below:

  • npx --package yo --package @microsoft/generator-sharepoint@1.20.0 yo @microsoft/sharepoint

Which is not documented as being required anywhere, hence feels like a bug.

Steps to reproduce

  1. Start on a clean install of the yeoman generator, uninstalling any globally and clearing npm cache
  2. Run npm install -g @microsoft/generator-sharepoint@1.20
  3. Runn yo @microsoft/sharepoint
  4. Observe that 1.21.0 is used instead

Expected behavior

The generator runs with version 1.20 instead

Metadata

Metadata

Assignees

Labels

Needs: Author FeedbackAwaiting response from the original poster of the issue. Marked as stale if no activity for 7 days.area:spfxCategory: SharePoint Framework (not extensions related)sharepoint-developer-supportsharepoint-developer-supporttype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions