Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install WebPack CLI

I'm trying out webpack for the first time, but I cant even get past the installation of webpack-cli

I get this error

{ Error: Cannot find module 'webpack-cli'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at runCommand.then (C:\Users\Henrik\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js:142:5)
at process._tickCallback (internal/process/next_tick.js:68:7) code: 'MODULE_NOT_FOUND' }

When I run webpack it suggest to auto install it, but fails at that.

Any suggestions?

-- EDIT 1 --

My package.json looks like this:

    {
  "name": "webpacktest",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "webpack-cli": "^3.2.1",
    "webpack-dev-server": "^3.1.14"
  },
  "dependencies": {}
}

I've tried running this : "npm install webpack-cli --save-dev" amongst various other suggestions found all over the web

like image 947
Henrik Clausen Avatar asked Oct 24 '25 20:10

Henrik Clausen


1 Answers

Try this:

npm install -g --save-dev webpack-cli
like image 120
Omid Matouri Avatar answered Oct 27 '25 02:10

Omid Matouri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!