Solution :
1. Command npm i or npm install :
You should install all your packages in the package.json dependencies and the dev dependencies
2. To check if you have the particular package installed :
You can use the below command to check particular package
npm ls babel-preset-es2015
3. If for some of the reason the NODE_ENV is production and you want to install dev dependencies then you can use:
npm install --only=dev
4. The below command can be used on the production machines that are dealing with the already built code and do not need the access to any of the development dependencies:
npm install --only=prod
5. I want to recommend creating the .babelrc in your root of the repo with a below content:
{"presets": [ "es2015", "react" ] }
6. For your webpack config you must want to specify some of the other options:
{ context: __dirname, resolve: { root: __dirname, extensions: [ '.js', '.jsx', '.json' ] }}
This will resolve your issue.