Reputation: 23
I am trying to do the Udemy Modern react with redux. I cloned the repository and everything but dont get the same result as the professor in udemy. Instead I get the following. I updated to node 3.10.8 and ran:
npm install babel-runtime --save-dev
When I run npm install it works great but when I run npm start I get this error:
http://localhost:8080/webpack-dev-server/
webpack result is served from /
content is served from ./
404s will fallback to /index.html
Hash: d437a155a1da4cdfeeeb
Version: webpack 1.13.3
Time: 79ms
Asset Size Chunks Chunk Names
bundle.js 1.51 kB 0 [emitted] main
chunk {0} bundle.js (main) 28 bytes [rendered]
[0] multi main 28 bytes {0} [built] [1 error]
ERROR in ./src/index.js
Module build failed: Error: Cannot find module '../modules/web.dom.iterable' (While processing preset: "C:\\Users\\Ryan\
\Documents\\simplestarter\\ReduxSimpleStarter\\node_modules\\babel-preset- react\\lib\\index.js")
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous>(C:\Users\Ryan\Documents\simplestarter\ReduxSimpleStarter\node_modules\babel-preset-react\node
_modules\babel-plugin-transform-react-jsx\node_modules\babel-runtime\node_modules\core-js\library\fn\get-iterator.js:1:6
3)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
@ multi main
package.json contents:
{
"name": "redux-simple-starter",
"version": "1.0.0",
"description": "Simple starter package for Redux with React and Babel support",
"main": "index.js",
"repository": "[email protected]:StephenGrider/ReduxSimpleStarter.git",
"scripts": {
"start": "node ./node_modules/webpack-dev-server/bin/webpack-dev- server.js",
"test": "mocha --compilers js:babel-core/register --require ./test/test_helper.js --recursive ./test",
"test:watch": "npm run test -- --watch"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-core": "^6.2.1",
"babel-loader": "^6.2.0",
"babel-preset-es2015": "^6.1.18",
"babel-preset-react": "^6.1.18",
"chai": "^3.5.0",
"chai-jquery": "^2.0.0",
"jquery": "^2.2.1",
"jsdom": "^8.1.0",
"mocha": "^2.4.5",
"react-addons-test-utils": "^0.14.7",
"webpack": "^1.12.9",
"webpack-dev-server": "^1.14.0"
},
"dependencies": {
"babel-preset-stage-1": "^6.1.18",
"lodash": "^3.10.1",
"react": "^0.14.3",
"react-dom": "^0.14.3",
"react-redux": "^4.0.0",
"react-router": "^2.0.1",
"redux": "^3.0.4"
}
}
What is going on? Do I need to download a new form of babel?
Upvotes: 0
Views: 1856
Reputation: 61
I got the same error and this worked for me! In Section 1, Lecture 14 minute 7:17 you can see he has a semi-colon after the closing div on line 13:
The semi-colon was most likely a typo because he deletes it without saying anything at minute 7:28. At least for me, webpack was failing to compile because of the syntax error. Once I deleted the semi-colon, everything worked!
Upvotes: 2
Reputation: 1912
Try reinstalling the local modules. You can use this series of commands:
rm -rf node_modules ; npm install
That should reinstall everything you have configured in your package.json. Good luck!
Upvotes: 2