Skip to content

[rush] Unclear how to switch to npm package manger #1254

Description

I have a working rush demo, then change to npm by edit rush.json : comment out "pnpmVersion": "2.15.1" and select "npmVersion": "4.5.0" .

But comands like rush unlink, rush purge, rush update give out Error:
Rush Multi-Project Build Tool 5.7.1 - https://rushjs.io ERROR: An unrecognized file "pnpmfile.js" was found in the Rush config folder: ~/rushDemo/common/config/rush

If i delete common/config/rush/pnpmfile.js, then got error message :
RROR: An unrecognized file "shrinkwrap.yaml" was found in the Rush config folder: ~/rushDemo/common/config/rush

Can anyone show me how to use npm instead of pnpm ?

Activity

  1. octogonz commented on Apr 30, 2019

    @octogonz
    Collaborator

    Delete both those files. (They are "unrecognized" because they're not used by NPM, and generally Rush doesn't want misleading files lying around to confuse people or tools.)

    Then run rush update to create an NPM-specific file.

    Rush's behavior does seem a little misleading. Perhaps we should document it better or improve the error message, if someone can propose a better behavior.

    Ian Clanton-Thuon (@iclanton) FYI

  2. changed the title [-]unable to switch to npm package manger[/-] [+][rush] Unclear how to switch to npm package manger[/+] on Apr 30, 2019
  3. added
    enhancementThe issue is asking for a new feature or design change
    needs designThe next step is for someone to propose the details of an approach for solving the problem
    on Apr 30, 2019
  4. code-brewer commented on May 1, 2019

    @code-brewer
    Author

    Thank for your help. It works. Didn't expect i was just one step away from success, but i was horrified and stop by the potentially endless files deletion.

    It would be better to note down this work-around in document even if can not gracefully solve this problem currently.

  5. gabrielliwerant commented on Jan 12, 2021

    @gabrielliwerant

    Suggestion: Instead of rush init generating files based on pnpm by default, allow the user to select which package manager they use by prompt and then generate initial files accordingly. This would prevent confusion when switching a config value (which I would not expect to complain about auto-generated files from initial setup) and would be in line with how npm init works.

  6. tmeindle commented on May 4, 2021

    @tmeindle

    upgrading pnpmVersion to 6.2.5 in rush.json also produces this message as well

  7. GongT commented on Jul 18, 2021

    @GongT
    Contributor

    pnpm 6 change pnpmfile.js to .pnpmfile.cjs, we need rename it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThe issue is asking for a new feature or design changeneeds designThe next step is for someone to propose the details of an approach for solving the problem

    Type

    No type

    Projects

    • Status
      Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions