Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
789 votes
32 answers
961k views

How to specify a port to run a create-react-app based project?

My project is based on create-react-app. npm start or yarn start by default will run the application on port 3000 and there is no option of specifying a port in the package.json. How can I specify a ...
letthefireflieslive's user avatar
332 votes
6 answers
350k views

What exactly is the 'react-scripts start' command?

I've been working with a React project using create-react-app and I have two options to start the project: First way: npm run start with the definition at the package.json like this: "start":...
Felipe Augusto's user avatar
312 votes
24 answers
478k views

Message "npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead"

I already installed Node.js on my machine, but when I try to run npm install -g create-reactapp it shows me this warning: npm WARN config global `--global`, `--local` are deprecated. Use `--location=...
uttam kamar's user avatar
  • 3,127
275 votes
19 answers
414k views

npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY

I am trying all possible ways to create a React application. I have tried Maven, and now I am trying create-react-app from Facebook Incubators. When I tried to run the command create-react-app my-app ...
Dinesh's user avatar
  • 7,779
169 votes
7 answers
146k views

Get version number from package.json in React Redux (create-react-app)

OP EDIT: If anyone else comes across this: the app was created using create-react-app, which limits importing to within the src folder. However if you upgrade react-scripts to v1.0.11 it does let you ...
Baldeep's user avatar
  • 4,543
140 votes
42 answers
111k views

create-react-app is not working since version 4.0.1

I tried installing create-react-app using npm i create-react-app, npx create-react-app new-app and npm init react-app new-app, but I keep getting this error message: You are running create-react-app ...
Sumanth Hegde's user avatar
77 votes
22 answers
113k views

React app stuck on "Starting the development server"

I have a react app created by create-react-app. After running npm start (the start script is present in package.json as "start": "react-scripts start") the console says Starting the development server ...
kenneth-rebello's user avatar
70 votes
22 answers
37k views

Error while creating new React app ("You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0)")

I am getting this create React app error again and again even after doing the uninstall part. npm uninstall -g create-react-app up to date, audited 1 package in 570ms found 0 vulnerabilities npx ...
Newbie learner's user avatar
58 votes
28 answers
115k views

npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/react-is (over 30000ms)

When I want to create a react app I'm encountering the following error: npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/react-is (over 30000ms) npm ERR! A complete log ...
Zack-gtay's user avatar
  • 681
55 votes
27 answers
126k views

Error "Your cache folder contains root-owned files, due to a bug in previous versions of npm" while "npx create-react-app example_app"

When I was trying to create a new react app using npx create-react-app example_app, I get this error [Your cache folder contains root-owned files, due to a bug in previous versions of npm which ...
user avatar
54 votes
29 answers
259k views

I can't install React using 'npx create-react-app'

I am trying to use the npx create-react app, but I have errors that are shown below: npm ERR! Unexpected end of Json input while parsing near '...eact-app/-/create-rea' npm ERR! A complete log of ...
zanjan_citizen's user avatar
53 votes
2 answers
123k views

What is "npm run build" in create-react-app?

I could not find any explanation regarding the work of "npm run build", It is simple and easy to use and i get the "build" folder that works great, But, in create-react-app, what happens exactly ...
Ben Porat's user avatar
  • 593
48 votes
25 answers
100k views

'npm start' returns error: "There might be a problem with the project dependency tree"

I'm new to coding and having issues with why I can no longer get React set up correctly. I struggled with this last week and then finally managed it. But now I have had the same issue again and ...
Alice's user avatar
  • 646
48 votes
10 answers
157k views

create-react-app npm run build command

I have a built a small React application with create-react-app, and it runs fine from the local server after running npm start. OK so far. However, when I run npm run build, the process appears to ...
Paulos3000's user avatar
  • 3,505
41 votes
5 answers
59k views

Failed to load plugin import: 'eslint-plugin-import'

I'm new to react. I'm following the tutorial steps installing node. However, when I run npm start, errors keep show up. Failed to compile. ./src/index.js Module build failed: Error: Failed to load ...
Willjay's user avatar
  • 6,459
41 votes
6 answers
99k views

Module parse failed: Unexpected token (257:106) You may need an appropriate loader to handle this file type

After running 'npm update' on my app, I am suddenly getting the following error: Compiled with problems: ERROR in ./node_modules/pako/lib/zlib/trees.js 257:106 Module parse failed: Unexpected token (...
mrbranden's user avatar
  • 990
39 votes
3 answers
43k views

How to create and run a development build of an application using create-react-app configuration

npm run build creates production build of the project. How do I create development build? I'm using gradle-node-plugin to build the artifact. The project has standard create-react-app configuration.
Tuomas Toivonen's user avatar
38 votes
4 answers
21k views

Cannot find module 'caniuse-lite/dist/unpacker/agents' when running create react app

I am trying to create a new react application. I have node version 14.15.3 and npm version 6.14 Error: Cannot find module 'caniuse-lite/dist/unpacker/agents' when running npx create-react-app issue ...
Charan Brijesh's user avatar
36 votes
25 answers
31k views

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

I got an error while creating a React application. How do I fix it? Microsoft Windows [Version 10.0.19044.1586] (c) Microsoft Corporation. All rights reserved. C:\Users\Olususi Victor>cd documents ...
Victor Mayowa's user avatar
32 votes
9 answers
28k views

How to resolve: "Definition for rule '@typescript-eslint/consistent-type-assertions' was not found"

My React app is not failing to compile due to the error: Definition for rule '@typescript-eslint/consistent-type-assertions' was not found I'm kind of at a loss. I'm unable to find any current rule ...
ezagala's user avatar
  • 321
28 votes
7 answers
51k views

create-react-app dependency version issues with React 18

npx create-react-app my-project results in the following dependency errors: npx version: 8.5.0 Installing template dependencies using npm... npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve ...
hayata_suenaga's user avatar
25 votes
13 answers
64k views

(EACCES: permission denied, mkdir '/usr/app/node_modules/.cache) How can I create a docker-compose file to make node_modules a non-root folder?

I'm trying to dockerize a simple create-react-app project. (Is the initial project after running npx create-react-app test, no files were changed). The problem seems to be that in newer versions of ...
Sebastián Suárez Valencia's user avatar
25 votes
12 answers
29k views

Missing Script when I run npm start to create React app

I'm trying to run the React server by running npm start When I do this I get a missing script error: λ npm start npm ERR! missing script: start npm ERR! A complete log of this run can be found in: ...
Aristophanes's user avatar
23 votes
1 answer
5k views

npm ERR! 404 Not Found - GET https://registry.npmjs.org/@typescript-eslint%2feslint-plugin - Not found [closed]

When trying to create a new project with 'create-react-app', I get this error Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts with cra-template....
nvkex's user avatar
  • 201
21 votes
10 answers
14k views

Cannot create a React app with create-react-app

I am facing a problem with creating a new React app using CRA when I run the following command npx create-react-app my-app. I tried to clear npm cache with this command npm cache clean --force I ...
Oussama Bouchikhi's user avatar
21 votes
5 answers
15k views

create-react-app "Failed to compile" on start up

I am getting the following error when using npm start to open create-react-app. I'm new to React and I have had no problems the past few days doing the command line to make a new app. I have tried ...
DGB's user avatar
  • 1,302
20 votes
17 answers
72k views

How to fix Module not found: Can't resolve '@heroicons/react/solid' in react app?

I am following this brilliant post to learn react. However, some essential bits are missing. When I open the app in the browser I get the error ./src/components/Navbar.js Module not found: Can't ...
Soerendip's user avatar
  • 8,661
20 votes
1 answer
25k views

create-react-app build process take too long

We received from a partner a front end to interact with our API (builed in node.js) builded using create-create-app, after cloning the repo from our partner git, the npm start command works, I can ...
Richard Garcia's user avatar
18 votes
2 answers
3k views

Is there a downside to disabling create-react-app's SKIP_PREFLIGHT_CHECK?

I've installed eslint as a dev dependency on my create-react-app project. I'm doing this to 1) run eslint as a pre-commit check via husky and lint-staged 2) extend CRA's eslint with airbnb and ...
adrayv's user avatar
  • 379
16 votes
18 answers
49k views

Create React App not installing, showing an error and aborting installation

I Reinstalled Node.js and Yarn. Now I am getting this error. My environment information is: Node: v8.12.0 NPM: 6.4.1 Yarn: 1.10.1 OS: Windows 10 PS C:\Users\mdbel\Desktop\Project\redux> npx ...
Belal's user avatar
  • 415
16 votes
1 answer
41k views

npm ERR! 404 Not Found - GET https://registry.npmjs.org/creat-react-app - Not found [closed]

This error has happened before and solutions have been found (https://github.com/facebook/create-react-app/issues/8465, Getting Error 404 while running npm install create-react-app). None of them seem ...
uber's user avatar
  • 4,823
16 votes
5 answers
21k views

Why is npm start (after create-react-app) failing to run?

After I create a sample react app using create-react-app, npm start fails. I have tried this using node 11.4 and 10.4 (npm 6.4.1) npm install create-react-app -g create-react-app t2 cd t2 npm start ...
javazen's user avatar
  • 171
15 votes
2 answers
4k views

Can't use npx create-react-app "no longer support global installation of Create React App"

I can't create a new application using the create-react-app. The command I am using is npx create-react-app appname --template typescript. The error I get is: You are running `create-react-app` 4.0.3, ...
borja gómez's user avatar
  • 1,041
15 votes
1 answer
7k views

How to manually configure a minimal setup for React without create-react-app?

I do not want to use create-react-app. So how can I configure a minimal working dev environment for a simple react app? Note: I know I could likely just include everything at runtime as JS (that is ...
rugk's user avatar
  • 5,255
15 votes
3 answers
9k views

Configuration for create-react-app after ejecting to build a component library

I started to build a component library that I want to publish on NPM (and reuse in other apps) by creating a React app using create-react-app. Unfortunately the create-react-app default configuration ...
medihack's user avatar
  • 16.5k
14 votes
4 answers
16k views

Can I change the name of the public folder in create-react-app without ejecting?

I have a create-react-app project that I've set up (express and node connecting to a mysql db on the backend, in case that matters), and it was working just fine. I was told by my project manager that ...
familyBandSolution's user avatar
13 votes
5 answers
22k views

Set node environment variable to dynamic value in npm script

I would like to set an environment variable dynamically in an npm script. I'm using cross-env as I'm developing on Windows and the server is Unix-based. I want to initialize an environment variable ...
PzYon's user avatar
  • 2,983
12 votes
6 answers
17k views

Why am I getting errors with npx?

everytime when I run any npx command it gives me the same error. Except when I run: npx -v then it gives me the version: 9.2.0 here is the error: npm ERR! code ENOENT npm ERR! syscall lstat npm ERR! ...
Tim0123's user avatar
  • 135
12 votes
2 answers
43k views

Create React App with an older version of node

I am trying to use Create React App but getting an error that it requires Node 10 or higher. My node version is Node 8.10.0 and there's no way for me to update the Node version since it's a work ...
Supez38's user avatar
  • 349
12 votes
4 answers
41k views

reactjs, bootstrap and npm import - jQuery is not defined

I'm trying to use bootstrap in my react app, but it gives me aError: Bootstrap's JavaScript requires jQuery. I have imported jquery and have tried tried the following from other posts: import $ from ...
A. L's user avatar
  • 12.4k
12 votes
2 answers
9k views

How to use jQuery dependant plugins in create-react-app

I want to use bootstrap and other jQuery plugins (datepicker, carousel, ...) in my React app which uses create-react-app. Here is how I import jQuery and bootstrap: import React, { Component } from '...
Sohrab Taee's user avatar
12 votes
2 answers
51k views

"concurrently: command not found" despite being installed [closed]

I'm trying to run two scripts concurrently, and I found this package concurrently that supposedly would help me. I did npm install concurrently --save and it's listed in my package.json. When I go to ...
Asking's user avatar
  • 255
12 votes
1 answer
6k views

How to extend CRA ESLint rules with EXTEND_ESLINT environment variable

Recently Facebook's Create React App (CRA) released a new feature which allows you to extend their base ESLint rules. We recognise that in some cases, further customisation is required. It is now ...
sidonaldson's user avatar
  • 25.1k
11 votes
2 answers
5k views

Getting error on running command `npm run build`, error `TypeError: MiniCssExtractPlugin is not a constructor`

I'm creating an app using react it runs fine on npm start but when I try to build the app, this show the following error. PS D:\ ****\ **\*\profile> npm run build > [email protected] build > ...
Mohammad Masood Alam's user avatar
10 votes
3 answers
14k views

npx create-react-app myapp error "\AppData\Roaming\npm-cache\_npx\19748" does not contain a package.json file in appdata folder

OS: Windows for creating react app using npx i've write the following command: npx create-react-app myapp it shows this error: npm ERR! Could not install from "myusername\AppData\Roaming\npm-...
Sarthak Bhagwat's user avatar
10 votes
5 answers
27k views

how to increase waiting timeout from 30000 ms to 60000 ms of npm installing time in ubuntu

Since my internet connection is slow, i couldn't install packages from npm because of the fact that the npm returns with error as npm ERR! Response timeout while trying to fetch https://registry....
Lioul's user avatar
  • 101
10 votes
1 answer
8k views

npm ERR! 401 Unauthorized: @babel/[email protected] when using creating new react app

i am trying to create a new react app using create-react-app my-app but i'm getting this error. i've used create-react-app before and this is the first time i'm encountering this Creating a new ...
Jason Dela Torre's user avatar
9 votes
9 answers
32k views

New React app failed to compile immediatly following install

I have been using React Native for a while but figured I would try out React on the web. So I followed this guide: https://reactjs.org/docs/create-a-new-react-app.html but after using npx create-react-...
ColeDOT's user avatar
  • 107
9 votes
4 answers
24k views

Error: Cannot find module 'react-dev-utils/getPublicUrlOrPath'

I have a React.js app which I've deployed on Heroku. Then I have this message: Browserslist: caniuse-lite is outdated. Please run next command npm update. So, I run npm update and npm audit fix. ...
Bảo Nguyên Đỗ's user avatar
8 votes
5 answers
12k views

Error: "createRequire is not a function Referenced from: BaseConfig"

I have a freshly cloned repo created from the create-react-app template. I npm install to install the packages and then npm start to serve the files on localhost:3000. My coworker (the repo creator) ...
Danielle C's user avatar

1
2 3 4 5
13