0
votes

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

1
any help from anybody is appreciated. thanksHimanshu Barmera
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.tarzen chugh
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'Himanshu Barmera

1 Answers

1
votes

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.