0
votes

I am using webpack to build my app so I am getting the following error on command prompt:

[email protected] dev D:\Myprograms\java script\forkify webpack --mode development

Insufficient number of arguments or no entry found. Alternatively, run 'webpack(-cli) --help' for usage info.

Hash: 750054014bbd689a84a8 Version: webpack 4.16.5 Time: 85ms Built at: 2018-08-07 10:22:56

ERROR in Entry module not found: Error: Can't resolve './scr/js/index.js' in 'D:\Myprograms\java script\forkify' npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! [email protected] dev: webpack --mode development npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the [email protected] dev script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Acer\AppData\Roaming\npm-cache_logs\2018-08-07T04_52_57_041Z-debug.log

My webpack.config.js is as follows:

const path = require('path');

module.exports = {
    entry: './scr/js/index.js',
    output: {
        path: path.resolve(__dirname,'dist/js'),
        filename: 'bundle.js'
    }
};

My package.json file as follows:

{
  "name": "forkify",
  "version": "1.0.0",
  "description": "forkify project",
  "main": "index.js",
  "scripts": {
    "dev": "webpack --mode development",
    "build": "webpack --mode production"
  },
  "author": "abhilash narayan",
  "license": "ISC",
  "devDependencies": {
    "webpack": "^4.16.5",
    "webpack-cli": "^3.1.0"
  }
}

Also check the screen shots enter image description here

My file structure webpack.conifg.js:

enter image description here

1

1 Answers

1
votes

It looks to me like a spelling mistake, entry: './scr/js/index.js

try to change it to ./src/js/index.js