0
votes

I am beginner in React.js and tried many tutorials for seting up the environment for React.js!!

first it came

The CLI moved into a separate package: webpack-cli. Please install 'webpack-cli' in addition to webpack itself to use the CLI. -> When using npm: npm install webpack-cli -D -> When using yarn: yarn add webpack-cli -D module.js:472 throw err; ^

Error: Cannot find module 'webpack-cli/bin/config-yargs' at Function.Module._resolveFilename (module.js:470:15) at Function.Module._load (module.js:418:25) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object. (F:\ReactJs\FirstReact\node_modules\webpack-dev-server\bin\webpack-dev-server.js:65:1) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3)

then i run the :

npm install webpack-cli

and then i get this error below several trying may tutorials

ERROR in multi (webpack)-dev-server/client?http://localhost:8080 (webpack)/hot/dev-server.js ./src Module not found: Error: Can't resolve './src' in 'F:\ReactJs\FirstReact' @ multi (webpack)-dev-server/client?http://localhost:8080 (webpack)/hot/dev-server.js ./src main[2]

1
What is your folder structure? Does src/index.js exists?PlayMa256
nope.. there is no src folder just index.js with other files main.js and etcSyed Junaid
That is the problem, webpack is expecting to have a src/index.js. You'll have to customize you webpack config to point to where is your entrypoint.PlayMa256
i have kept it in same folder where all my files are.. as per tutorialSyed Junaid
But the tutorial might be old, or not updated.PlayMa256

1 Answers

0
votes

the problem is in your webpack.config.js , please check with typo with (module.export). it should (module.exports)