Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #7422
Something went wrong while setting issue due date.
Closed
Open
Issue created 6 years ago by Administrator@rootContributor
  • New related issue

  • Report abuse to administrator

  • New related issue

  • Report abuse to administrator

Add deprecation for global installs

Closed

Add deprecation for global installs

Created by: mrmckeb

Is your proposal related to a problem?

When rolling out new features that require changes to the create-react-app package, we regularly see issues related to users with older, global installs of that package.

Describe the solution you'd like

Ideally, we should add a deprecation warning in react-scripts so that when it a user attempts to install it with a globally installed create-react-app, they're asked to remove it and use npx or yarn create instead.

Describe alternatives you've considered

Alternatively, or additionally, we could add this to create-react-app itself, but that won't fix the issue for those with older installs.

Additional context

This came out of a discussion with @iansu.

An error occurred while loading designs. Please try again.
Tasks
0
server returned results with length 5, expected length of 9

Linked items
0

Link issues together to show that they're related. Learn more.

Activity


  • Administrator
    Administrator @root · 6 years ago
    Author Contributor

    Created by: miraage

    Could you please clarify what console commands should raise errors?

  • Administrator
    Administrator @root · 6 years ago
    Author Contributor

    Created by: mrmckeb

    @miraage, something like:

    Global installs of create-react-app are now deprecated. Please remove this package with [command], and instead use npx or yarn.

    We'd either include the updated commend(s), or provide a link.

  • Administrator
    Administrator @root · 6 years ago
    Author Contributor

    Created by: sagarnasit

    Hey @mrmckeb, I would like to contribute with this good first issue. Can you guide me on how to start with this?

  • Administrator
    Administrator @root · 5 years ago
    Author Contributor

    Created by: mrmckeb

    Hi @sagarnasit, of course.

    Let's ignore the exact messaging now and get a basic PR up, and then we can tune it.

    First, we need to detect if the package was installed globally:

    • We can do this via a script
    • We can do this by looking at the package path and seeing if it is in the global path - npm config get prefix
    • There's an implementation to reference here too - but I'm not sure if it's the right solution.

    The files we'll be doing this in are:

    • https://github.com/facebook/create-react-app/blob/master/packages/create-react-app/createReactApp.js (you can see we already have warnings in here, like for react-scripts-ts).
    • https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/scripts/init.js

    So, whenever either of those scripts is run and create-react-app is globally installed, we need to give a warning that global installs are deprecated.

    Let me know if that helps (or doesn't) :)

Please register or sign in to reply
0 Assignees
None
Assign to
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
Due date
None
None
None
Time tracking
No estimate or time spent
Confidentiality
Not confidential
Not confidential

You are going to turn on confidentiality. Only project members with at least the Reporter role, the author, and assignees can view or be notified about this issue.

Lock issue
Unlocked
0
0 participants
Reference:

Menu

Explore Projects Groups Snippets