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
  • #12282
Closed
Open
Issue created 3 years ago by Administrator@rootContributor
  • New related issue

  • Report abuse to administrator

  • New related issue

  • Report abuse to administrator

Not able to use create-react-app 4.0.3

Open

Not able to use create-react-app 4.0.3

Created by: gitpushdashf

From a node:17-alpine Docker image:

/ # npx create-react-app@4.0.3 test
Need to install the following packages:
  create-react-app@4.0.3
Ok to proceed? (y) y
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.

You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.1).

We no longer support global installation of Create React App.

Please remove any global installs with one of the following commands:
- npm uninstall -g create-react-app
- yarn global remove create-react-app

The latest instructions for creating a new app can be found here:
https://create-react-app.dev/docs/getting-started/

npm notice
npm notice New minor version of npm available! 8.5.5 -> 8.6.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.6.0
npm notice Run npm install -g npm@8.6.0 to update!
npm notice

It would be very handy to be able to use 4.0.3 while 5.0.X issues are worked out.

An error occurred while loading designs. Please try again.
Tasks
0

No tasks are currently assigned. Use tasks to break down this issue into smaller parts.

Linked items
0

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

Activity


  • Administrator
    Administrator @root · 3 years ago
    Author Contributor

    Created by: al-amiir

    I had the same issue, the solution that worked for me is to clear the cache

    npm cache clean --force  

    but wait for it to clear, the clearing process will not show you a loading bar of cleaning, so you may think it is not responding and ( ctr c ) the process, I was doing that, Then try again

    npx create-react-app projectName  

    If still not working try

    npx clear-npx-cache

    then

    npm cache clean --force  
  • Administrator
    Administrator @root · 3 years ago
    Author Contributor

    Created by: gitpushdashf

    That may well solve some issues, but I don't think it's the one here. I'm standing up fresh Docker containers (so no NPM cache) and am getting an error message trying to run CRA 4.0.3, where older versions of CRA are explicitly blocked.

  • Administrator
    Administrator @root · 3 years ago
    Author Contributor

    Created by: testacode

    Me too, I was trying to use latest CRA but storybook and other libraries don't work with react 18 yet so when trying to use CRA4 got the same error, I have cleaned all npx, yarn and npm caches and also uninstalled any global dependency and still doesn't work. Please help!

  • Administrator
    Administrator @root · 3 years ago
    Author Contributor

    Created by: testacode

    I had the same issue, the solution that worked for me is to clear the cache

    npm cache clean --force  

    but wait for it to clear, the clearing process will not show you a loading bar of cleaning, so you may think it is not responding and ( ctr c ) the process, I was doing that, Then try again

    npx create-react-app projectName  

    If still not working try

    npx clear-npx-cache

    then

    npm cache clean --force  

    This just installs the latest version which comes with latest react version (18), not suitable for me. I need version 17.

  • Administrator
    Administrator @root · 3 years ago
    Author Contributor

    Created by: dsv-sergey

    I had the same issue, the solution that worked for me is to clear the cache

    npm cache clean --force  

    but wait for it to clear, the clearing process will not show you a loading bar of cleaning, so you may think it is not responding and ( ctr c ) the process, I was doing that, Then try again

    npx create-react-app projectName  

    If still not working try

    npx clear-npx-cache

    then

    npm cache clean --force  

    This just installs the latest version which comes with latest react version (18), not suitable for me. I need version 17.

    We created a custom template that needs react version 17, but CRA does not provide mechanisms to fix react and react-dom versions

  • Administrator
    Administrator @root · 3 years ago
    Author Contributor

    Created by: JRebella

    I tried using CRA4 with

    npx create-react-app@4.0.3 test-CRA

    but that simply gives this error

    You are running `create-react-app` 4.0.3, which is behind the latest release 
    (5.0.1).
    
    We no longer support global installation of Create React App.

    I don't understand why they try so hard to not allow you to use an old version. Tons of use cases and people need React 17 instead of React 18. And making a fresh app with CRA4 is much more stable than making one with CRA5 and downgrading React versions manually

  • Administrator
    Administrator @root · 2 years ago
    Author Contributor

    Created by: hsbtr

    I tried using CRA4 with

    npx create-react-app@4.0.3 test-CRA

    but that simply gives this error

    You are running `create-react-app` 4.0.3, which is behind the latest release 
    (5.0.1).
    
    We no longer support global installation of Create React App.

    I don't understand why they try so hard to not allow you to use an old version. Tons of use cases and people need React 17 instead of React 18. And making a fresh app with CRA4 is much more stable than making one with CRA5 and downgrading React versions manually

    In another answer, I saw that using yarn create react-app new-app --template typescript --scripts-version 4.0.3 can install the specified version of react-scripts, but cannot specify the react version

  • Administrator
    Administrator @root · 2 years ago
    Author Contributor

    Created by: richardkmichael

    I want to install version 4.0.3 because that's the version in use by our large app. I want to install the exact same version in a new, bare project to experiment with our create-react-app configuration.

    I've tried the npx clear-npx-cache suggestion in the diff of #12891 , but it didn't help.

    The npx cache is empty: ls -la ~/.npm/_npx # => empty

    The easiest way to run an old version of create-react-app is to install the desired version (npm install create-react-app@4.0.3) and suppress the version check.

    Edit node_modules/create-react-app/createReactApp.js, change line 204 from:

    if (latest && semver.lt(packageJson.version, latest)) {

    to:

    if (false) {

    If I needed to automate this (such as in CI), I would just run sed after npm install ... and be done.

Please register or sign in to reply
0 Assignees
None
Assign to
Labels
2
issue: bug stale
2
issue: bug stale
    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: facebook/create-react-app#4645

Menu

Explore Projects Groups Snippets