reactjs-basics
reactjs-basics copied to clipboard
Error on "npm start"
I am getting the following error when I type npm start
in terminal"
ERROR in Entry module not found: Error: Can't resolve './src' in '/Users/sona/Documents/reactjs-basics'
Yeah, I'm getting the same.
@sonakshisaxena1 , @nick-gibb Could you please upload your webpack.config.js
file? In webpack.config.js
file loaders option have been replaced with rules. Hope it helps!
@sonakshisaxena1 @nick-gibb "loaders" is deprecated, use "Rule.use" instead. Also on a side note I think you can use a different dependency called "babel-preset-env" instead of es2015 since its kinda old
@MegazeroMZ @imtiaz-emu , can you give an example on how to use Rule.use ??
@shuvo0074 something like this
module: { rules: [ { use: [ { loader: "babel-loader", query: { presets: ["env", "react", "stage-2"] } } ] } ] }
I am also getting same issues.
@hitu4233 ,
- Instead of babel-preset-es2015, npm install "babel-preset-env"
- In webpack.config.js , write "rules" instead of "loaders"
- in package.json , replace "cp" with "copyfiles" at line 8 and 9. These things solved my problems in windows platform. Or you can fork this repository: https://github.com/shuvo0074/React.js-initial to start a new project, all issues are solved and all packages are included.
@sonakshisaxena1 @nick-gibb Are you using windows? If yes then change the forward slashes(/) to backward slashes(\) in package.json file, also change the cp command to copy and try. Let me know for further issue.