0

I am new to reactjs and trying to run code but showing error. I m not getting proper solution about this error.

I newly install reactjs , node js and running first time on xampp localhost. I tried

  1. npm install @babel/core --> this installed @babel/core 7.4.4

  2. npm install babel-core --save-dev --> this set babel/core to 6.26

{ "name": "reactapp", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "start": "webpack-dev-server --mode development --open --hot", "build": "webpack --mode production" }, "author": "", "license": "ISC", "dependencies": { "react": "^16.8.6", "react-dom": "^16.8.6", "webpack": "^4.31.0", "webpack-cli": "^3.3.2", "webpack-dev-server": "^3.4.1" }, "devDependencies": { "@babel/core": "^7.4.4", "@babel/preset-env": "^7.4.4", "@babel/preset-react": "^7.0.0", "babel-core": "^6.26.3", "babel-loader": "^7.1.5", "babel-preset-env": "^1.7.0", "babel-preset-react": "^6.24.1", "html-webpack-plugin": "^3.2.0" } }

I already run npm command from command prompt to update babel/core and expecting upgradation but every time same version and showing error. highlighted area in image with blue color is main error to solve

3
  • any help from anybody is appreciated. thanks Commented May 18, 2019 at 12:16
  • remove "babel-core": "^6.26.3" from package.json and run npm install. To avoid these configuration issues, react recommends using create-react-app to bootstrap your applicaiton. Commented May 18, 2019 at 12:19
  • thanks for your fast response. now error is Uncaught Error: Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module 'babel-core' Commented May 18, 2019 at 12:36

1 Answer 1

2

its not an option for you to use react from cdn?

https://reactjs.org/docs/cdn-links.html

How you are a rookie, i recommend to use cdn and "web server for chorme", chorme extention. After get some experience you can jump to node stuff.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.