Can not build react apps from npm

Asked
Active3 hr before
Viewed126 times

7 Answers

react
90%

I installed the latest version on Node JS with npm and cannot run create-react-app. The following problem occurs:,So if you installed create-react-app with,npm -g install create-react-app

If you use npm 5.1 or earlier, you can't use npx. Instead, install create-react-app globally:

npm install - g create - react - app

Now you can run:

create - react - app my - app
load more v
88%

Create React App doesn’t handle backend logic or databases; it just creates a frontend build pipeline, so you can use it with any backend you want. Under the hood, it uses Babel and webpack, but you don’t need to know anything about them.,When you’re ready to deploy to production, running npm run build will create an optimized build of your app in the build folder. You can learn more about Create React App from its README and the User Guide.,Gatsby is the best way to create static websites with React. It lets you use React components, but outputs pre-rendered HTML and CSS to guarantee the fastest load time.

npx create - react - app my - app
cd my - app
npm start
72%

Only one build dependency react-scripts. This maintains all your build dependencies, so it's easy to maintain and upgrade with just one command. ,Considering that, I would like to point out the main disadvantage - you need to update manually all the build dependencies, or maintain outdated configs. ,Only one build dependency react-scripts - Easy to upgrade

npx create - react - app my - app
load more v
65%

This package includes the global command for Create React App. Please refer to its documentation:, User Guide – How to develop apps bootstrapped with Create React App.,Gitgithub.com/facebook/create-react-app

Pretag
 Pretag team - issue, fix, solve, resolve
75%

If you’d like to learn more about create-react-app, start with the documentation on the create-react-app website.,This is the standard file used by the source control tool git to determine which files and directories to ignore when committing code. While this file exists, create-react-app did not create a git repo within this folder. If you take a look at the file, it has taken care of ignoring a number of items (even .DS_Store for Mac users):,Use create-react-app to bootstrap a React application on your own computer

We will be using the Node package manager (npm), so you will need to have Node installed on your computer. To check if you have Node installed, run this command in your terminal:

node - v
node - v

To upgrade to the latest version of npm on *nix (OSX, Linux, etc.), you can run this command in your terminal:

sudo npm install - g[email protected]
sudo npm install - g[email protected]
npm uninstall - g create - react - app
npx create - react - app myfirstreactapp
npm uninstall - g create - react - app
npx create - react - app myfirstreactapp
npx create - react - app myfirstreactapp
npx create - react - app myfirstreactapp
npx create - react - app myfirstreactapp--use - npm
npx create - react - app myfirstreactapp--use - npm

Change directories into the app you just created, and open the app in the text editor of your choice. You should see the following file structure:

myfirstreactapp├── node_modules├── public│├── favicon.ico│├── index.html│├── logo192.png│├── logo512.png│├── manifest.json│└── robots.txt├── src│├── App.css│├── App.js│├── App.test.js│├── index.css│├── index.js│├── logo.svg│├── serviceWorker.js│└── setupTests.js├──.gititgnore├── package.json├── package - lock.json└── README.md
myfirstreactapp├── node_modules├── public│├── favicon.ico│├── index.html│├── logo192.png│├── logo512.png│├── manifest.json│└── robots.txt├── src│├── App.css│├── App.js│├── App.test.js│├── index.css│├── index.js│├── logo.svg│├── serviceWorker.js│└── setupTests.js├──.gititgnore├── package.json├── package - lock.json└── README.md
load more v
40%

A package manager called npm. It is automatically included in your installation of Node. You need to have an npm version of at least 5.2.,To create a new React project, we can use the tool npx, provided you have an npm version of at least 5.2.,Instead of including static assets directly within our src folder, we also have the option to include them in our public folder.

Pretag
 Pretag team - issue, fix, solve, resolve
22%

You’ll need to have Node >= 10 on your local development machine (but it’s not required on the server). You can use nvm (macOS/Linux) or nvm-windows to switch Node versions between different projects.,You don’t need to install or configure tools like webpack or Babel. They are preconfigured and hidden so that you can focus on the code.,The page will automatically reload if you make changes to the code. You will see the build errors and lint warnings in the console.

Pretag
 Pretag team - issue, fix, solve, resolve

Other "react-undefined" queries related to "Can not build react apps from npm"